Merge pull request #1868 from BillSeurer/ppc-floats
authorAlex Rønne Petersen <alex@alexrp.com>
Thu, 11 Jun 2015 21:24:26 +0000 (23:24 +0200)
committerAlex Rønne Petersen <alex@alexrp.com>
Thu, 11 Jun 2015 21:24:26 +0000 (23:24 +0200)
[ppc] Basic powerpc64 little endian enablement

118 files changed:
.gitmodules
configure.ac
eglib/src/gmisc-unix.c
external/Lucene.Net [deleted submodule]
external/Lucene.Net.Light [new submodule]
external/ikdasm
external/ikvm
mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/AssemblyResolver.cs
mcs/class/Mono.Debugger.Soft/Test/dtest-app.cs
mcs/class/Mono.Debugger.Soft/Test/dtest.cs
mcs/class/System.Core/System.IO.MemoryMappedFiles/MemoryMappedViewAccessor.cs
mcs/class/System.Core/System.IO.MemoryMappedFiles/MemoryMappedViewStream.cs
mcs/class/System.Core/Test/System.IO.MemoryMappedFiles/MemoryMappedFileTest.cs
mcs/class/System.Drawing/Test/System.Drawing/TestFont.cs
mcs/class/System.IO.Compression/SharpCompress/Archive/AbstractWritableArchive.cs
mcs/class/System.IO.Compression/SharpCompress/Archive/Zip/ZipArchive.cs
mcs/class/System.IO.Compression/SharpCompress/Writer/Zip/ZipWriter.cs
mcs/class/System.IO.Compression/ZipArchive.cs
mcs/class/System.Net.Http/System.Net.Http.Headers/HeaderInfo.cs
mcs/class/System.Net.Http/System.Net.Http.Headers/HttpHeaders.cs
mcs/class/System.Net.Http/System.Net.Http/HttpClientHandler.cs
mcs/class/System.Net.Http/System.Net.Http/HttpContent.cs
mcs/class/System.Net.Http/Test/System.Net.Http/MultipartContentTest.cs
mcs/class/System.Web.Routing/System.Web.Routing/RouteCollection.cs
mcs/class/System.Web/System.Web.Configuration_2.0/HttpRuntimeSection.cs
mcs/class/System.Web/System.Web.Hosting/HostingEnvironment.cs
mcs/class/System.Web/System.Web/DynamicModuleManager.cs [new file with mode: 0644]
mcs/class/System.Web/System.Web/HttpApplication.cs
mcs/class/System.Web/net_4_5_System.Web.dll.sources
mcs/class/System.Xaml/Assembly/AssemblyInfo.cs
mcs/class/System/System.Diagnostics/Process.cs
mcs/class/System/System.IO/KeventWatcher.cs
mcs/class/System/System.Net/HttpWebRequest.cs
mcs/class/System/Test/System.Diagnostics/ProcessTest.cs
mcs/class/System/mobile_System.dll.sources
mcs/class/WindowsBase/Assembly/AssemblyInfo.cs
mcs/class/corlib/Makefile
mcs/class/corlib/System.IO/UnmanagedMemoryAccessor.cs [deleted file]
mcs/class/corlib/System.Reflection/MonoAssembly.cs
mcs/class/corlib/System.Reflection/MonoMethod.cs
mcs/class/corlib/System.Runtime.InteropServices/Marshal.cs
mcs/class/corlib/System.Security/CodeAccessPermission.cs
mcs/class/corlib/System.Security/PermissionSet.cs
mcs/class/corlib/System.Security/SecurityFrame.cs
mcs/class/corlib/System.Security/SecurityManager.cs
mcs/class/corlib/System.Security/SecurityManager_mobile.cs
mcs/class/corlib/System.Text/EncodingHelper.cs
mcs/class/corlib/System.Threading/CompressedStack.cs
mcs/class/corlib/System/TimeZoneInfo.cs
mcs/class/corlib/Test/System.Reflection/AssemblyTest.cs
mcs/class/corlib/corlib.dll.sources
mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/LambdaCompiler.Binary.cs
mcs/class/monodoc/monodoc.dll.sources
mcs/errors/CS0122-38-lib.cs [new file with mode: 0644]
mcs/errors/Makefile
mcs/errors/cs0122-38.cs [new file with mode: 0644]
mcs/errors/cs9030-2.cs [new file with mode: 0644]
mcs/mcs/delegate.cs
mcs/mcs/ecore.cs
mcs/mcs/expression.cs
mcs/mcs/import.cs
mcs/mcs/property.cs
mcs/tests/dtest-061.cs [new file with mode: 0644]
mcs/tests/test-910.cs
mcs/tests/test-925.cs [new file with mode: 0644]
mcs/tests/ver-il-net_4_5.xml
mono/io-layer/processes.c
mono/metadata/boehm-gc.c
mono/metadata/class-internals.h
mono/metadata/class.c
mono/metadata/debug-helpers.c
mono/metadata/icall-def.h
mono/metadata/icall.c
mono/metadata/loader.c
mono/metadata/metadata.c
mono/metadata/object-offsets.h
mono/metadata/profiler.c
mono/metadata/security-manager.c
mono/metadata/security-manager.h
mono/metadata/sgen-mono.c
mono/metadata/threadpool-ms.c
mono/mini/Makefile.am.in
mono/mini/aot-compiler.c
mono/mini/aot-runtime.c
mono/mini/aot-tests.cs
mono/mini/basic-float.cs
mono/mini/debugger-agent.c
mono/mini/exceptions-amd64.c
mono/mini/exceptions-x86.c
mono/mini/exceptions.cs
mono/mini/method-to-ir.c
mono/mini/mini-amd64.c
mono/mini/mini-amd64.h
mono/mini/mini-arm.c
mono/mini/mini-codegen.c
mono/mini/mini-generic-sharing.c
mono/mini/mini-llvm.c
mono/mini/mini-runtime.c
mono/mini/mini-trampolines.c
mono/mini/mini-x86.c
mono/mini/mini.c
mono/mini/mini.h
mono/mini/seq-points.c
mono/mini/tramp-amd64.c
mono/profiler/decode.c
mono/profiler/proflog.c
mono/tests/Makefile.am
mono/tests/bug-17590.cs
mono/unit-tests/Makefile.am
mono/utils/Makefile.am
mono/utils/mono-compiler.h
mono/utils/mono-complex.h [new file with mode: 0644]
mono/utils/mono-context.c
mono/utils/mono-dl-darwin.c
mono/utils/mono-dl-posix.c
mono/utils/mono-dl-windows.c
mono/utils/mono-dl.h
mono/utils/mono-threads.h

index 858838fc78f6b5a52e6602e3ee0fcf4723143f93..ee9a2ecdffda2721ce68ac538616e36d829f6b0a 100644 (file)
@@ -17,9 +17,6 @@
 [submodule "external/ikvm"]
        path = external/ikvm
        url = git://github.com/mono/ikvm-fork.git
-[submodule "external/Lucene.Net"]
-       path = external/Lucene.Net
-       url = git://github.com/mono/lucene.net.git
 [submodule "external/ikdasm"]
        path = external/ikdasm
        url = git://github.com/mono/ikdasm.git
@@ -30,3 +27,6 @@
 [submodule "external/reference-assemblies"]
        path = external/binary-reference-assemblies
        url = git://github.com/mono/reference-assemblies.git
+[submodule "external/Lucene.Net.Light"]
+       path = external/Lucene.Net.Light
+       url = git://github.com/mono/Lucene.Net.Light.git
index f02e6526f9e7966753e57442c62e01c3364c3ebe..d7bfc65a77d237dacf034f05ceab6b07a3c9956e 100644 (file)
@@ -3239,7 +3239,7 @@ case "$host" in
        X11="libX11.so.6"
        ;;
     *-*-*freebsd*)
-       LIBC="libc.so"
+       LIBC="libc.so.7"
        INTL="libintl.so"
        SQLITE="libsqlite.so"
        SQLITE3="libsqlite3.so"
index 860b9304692d4b09210e456c7eea1d50037e6912..273024871c5f890e01410f8a12094cf256cd33d8 100644 (file)
@@ -93,24 +93,29 @@ get_pw_data (void)
                pthread_mutex_unlock (&pw_lock);
                return;
        }
+
+       home_dir = g_getenv ("HOME");
+       user_name = g_getenv ("USER");
+
 #ifdef HAVE_GETPWUID_R
-       if (getpwuid_r (getuid (), &pw, buf, 4096, &result) == 0) {
-               home_dir = g_strdup (pw.pw_dir);
-               user_name = g_strdup (pw.pw_name);
+       if (home_dir == NULL || user_name == NULL) {
+               if (getpwuid_r (getuid (), &pw, buf, 4096, &result) == 0) {
+                       if (home_dir == NULL)
+                               home_dir = g_strdup (pw.pw_dir);
+                       if (user_name == NULL)
+                               user_name = g_strdup (pw.pw_name);
+               }
        }
 #endif
+
+       if (user_name == NULL)
+               user_name = "somebody";
        if (home_dir == NULL)
-               home_dir = g_getenv ("HOME");
+               home_dir = "/";
 
-       if (user_name == NULL) {
-               user_name = g_getenv ("USER");
-               if (user_name == NULL)
-                       user_name = "somebody";
-       }
        pthread_mutex_unlock (&pw_lock);
 }
 
-/* Give preference to /etc/passwd than HOME */
 const gchar *
 g_get_home_dir (void)
 {
diff --git a/external/Lucene.Net b/external/Lucene.Net
deleted file mode 160000 (submodule)
index 88fb67b..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit 88fb67b07621dfed054d8d75fd50672fb26349df
diff --git a/external/Lucene.Net.Light b/external/Lucene.Net.Light
new file mode 160000 (submodule)
index 0000000..85978b7
--- /dev/null
@@ -0,0 +1 @@
+Subproject commit 85978b7eb94738f516824341213d5e94060f5284
index a3de8ec435d47292363b3012e76e2bc05e412d6d..3bf7a4b54385a2f3765a85c0bae23190169f5c0a 160000 (submodule)
@@ -1 +1 @@
-Subproject commit a3de8ec435d47292363b3012e76e2bc05e412d6d
+Subproject commit 3bf7a4b54385a2f3765a85c0bae23190169f5c0a
index 061a13cc772ef15f4d5528eb84fea4d51d4bda1d..dab43d5cf4bf3b8b9a5b5f8cb175dee38a5fe69f 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 061a13cc772ef15f4d5528eb84fea4d51d4bda1d
+Subproject commit dab43d5cf4bf3b8b9a5b5f8cb175dee38a5fe69f
index bf14075f7ff0dd040cf264e7dca6a96a9c4300fd..5e0ec480956b7199675a256d60af3be29f248df5 100644 (file)
@@ -311,25 +311,44 @@ namespace Microsoft.Build.Tasks {
                                                SearchPath.HintPath, specific_version);
                }
 
-               static Dictionary<string, AssemblyName> assemblyNameCache = new Dictionary<string, AssemblyName> ();
+               class CachedAssemblyName
+               {
+                       public DateTime Time;
+                       public AssemblyName Name;
+               }
+
+               static Dictionary<string, CachedAssemblyName> assemblyNameCache = new Dictionary<string, CachedAssemblyName> ();
                public bool TryGetAssemblyNameFromFile (string filename, out AssemblyName aname)
                {
-                       filename = Path.GetFullPath (filename);
-                       if (assemblyNameCache.TryGetValue (filename, out aname))
+                       FileInfo info = new FileInfo (filename);
+                       if (!info.Exists) {
+                               aname = null;
+                               LogSearchMessage ("Considered '{0}' as a file, but the file does not exist",
+                                                 filename);
+                               return false;
+                       }
+                       filename = info.FullName;
+                       CachedAssemblyName cachedName;
+                       if (assemblyNameCache.TryGetValue (filename, out cachedName) && cachedName.Time == info.LastWriteTime) {
+                               aname = cachedName.Name;
                            return aname != null;
+                       }
 
+                       cachedName = new CachedAssemblyName ();
+                       cachedName.Time = info.LastWriteTime;
                        aname = null;
                        try {
-                               aname = AssemblyName.GetAssemblyName (filename);
+                               cachedName.Name = aname = AssemblyName.GetAssemblyName (filename);
                        } catch (FileNotFoundException) {
                                LogSearchMessage ("Considered '{0}' as a file, but the file does not exist",
                                                filename);
+                               return false;
                        } catch (BadImageFormatException) {
                                LogSearchMessage ("Considered '{0}' as a file, but it is an invalid assembly",
                                                filename);
                        }
 
-                       assemblyNameCache [filename] = aname;
+                       assemblyNameCache [filename] = cachedName;
                        return aname != null;
                }
 
index c8c037d7a50bc4f6ea243075487f98a4079e8144..dcc840d9886e84e0036186db99d1817271a348ea 100644 (file)
@@ -80,7 +80,7 @@ public class Tests2 {
        }
 }
 
-public struct AStruct {
+public struct AStruct : ITest2 {
        public int i;
        public string s;
        public byte k;
@@ -116,6 +116,14 @@ public struct AStruct {
        public void invoke_mutate () {
                l = 5;
        }
+
+       public int invoke_iface () {
+               return i;
+       }
+
+       public override string ToString () {
+               return i.ToString ();
+       }
 }
 
 public class GClass<T> {
index 409e775fd66473399a9a7658b4df4edf67fc4803..e51cdc061a0accf8d07308fa4bbf81ffa194a440 100644 (file)
@@ -526,7 +526,11 @@ public class DebuggerTests
                e = step_over ();
                assert_location (e, "ss_nested");
                e = step_into ();
-               assert_location (e, "ss_nested_3");
+               assert_location (e, "ss_nested_1");
+               e = step_into ();
+               assert_location (e, "ss_nested_1");
+               e = step_into ();
+               assert_location (e, "ss_nested");
                req.Disable ();
 
                // Check DebuggerStepThrough support
@@ -1625,8 +1629,8 @@ public class DebuggerTests
                                AssertValue ("AB", vals [i]);
                        if (locals [i].Name == "t")
                                AssertValue ("ABC", vals [i]);
-                       if (locals [i].Name == "alist")
-                               ;
+                       if (locals [i].Name == "alist") {
+                       }
                }
 
                // Argument checking
@@ -2269,6 +2273,17 @@ public class DebuggerTests
                task = s.InvokeMethodAsyncWithResult (e.Thread, m, null);
                out_this = task.Result.OutThis as StructMirror;
                Assert.AreEqual (null, out_this);
+
+               // interface method
+               var cl1 = frame.Method.DeclaringType.Assembly.GetType ("ITest2");
+               m = cl1.GetMethod ("invoke_iface");
+               v = s.InvokeMethod (e.Thread, m, null);
+               AssertValue (42, v);
+
+               // virtual method
+               m = vm.RootDomain.Corlib.GetType ("System.Object").GetMethod ("ToString");
+               v = s.InvokeMethod (e.Thread, m, null, InvokeOptions.Virtual);
+               AssertValue ("42", v);
 #endif
        }
 
index 783aa9142fbbc18bd8d8adc57259b592eea12cec..8bb8fc31b4bc02b206608b19910c91832463365c 100644 (file)
@@ -37,12 +37,19 @@ namespace System.IO.MemoryMappedFiles
        public sealed class MemoryMappedViewAccessor : UnmanagedMemoryAccessor, IDisposable {
                IntPtr mmap_handle;
                SafeMemoryMappedViewHandle safe_handle;
+               long pointerOffset;
 
                internal MemoryMappedViewAccessor (IntPtr handle, long offset, long size, MemoryMappedFileAccess access)
                {
+                       pointerOffset = offset;
                        Create (handle, offset, size, access);
                }
 
+               public long PointerOffset
+               {
+                       get { return pointerOffset; }
+               }
+
                static FileAccess ToFileAccess (MemoryMappedFileAccess access)
                {
                        switch (access){
index 58f933ae7921fdaea243b1a09a993d0dde7db64e..6fbaca605f900dd66241e5ed1a6cdbbad3d3f933 100644 (file)
@@ -36,12 +36,19 @@ namespace System.IO.MemoryMappedFiles
        public sealed class MemoryMappedViewStream : UnmanagedMemoryStream {
                IntPtr mmap_handle;
                object monitor;
-               
+               long pointerOffset;
+
                internal MemoryMappedViewStream (IntPtr handle, long offset, long size, MemoryMappedFileAccess access) {
+                       pointerOffset = offset;
                        monitor = new Object ();
                        CreateStream (handle, offset, size, access);
                }
 
+               public long PointerOffset
+               {
+                       get { return pointerOffset; }
+               }
+
                public SafeMemoryMappedViewHandle SafeMemoryMappedViewHandle { 
                        get {
                                throw new NotImplementedException ();
index f64d0c54477b7dd9e8281190050979a0aeb5bdb4..c07666a29c6d97de26b9037c2e5d60e95c43f584 100644 (file)
@@ -214,6 +214,39 @@ namespace MonoTests.System.IO.MemoryMappedFiles {
                        }
                }
 
+               [Test]
+               public unsafe void ViewAccessorReadArrayWithOffset () {
+                       var file = MemoryMappedFile.CreateFromFile (fname, FileMode.Open);
+                       var offset = 3;
+                       var expected = "lo!";
+
+                       using (var v = file.CreateViewAccessor (offset, expected.Length)) {
+                               Assert.AreEqual (offset, v.PointerOffset);
+
+                               var a = new byte [expected.Length];
+                               var n = v.ReadArray (0, a, 0, expected.Length);
+                               Assert.AreEqual (expected.Length, n);
+                               var s = new string (Array.ConvertAll (a, b => (char)b));
+                               Assert.AreEqual (expected, s);
+                       }
+               }
+
+               [Test]
+               public unsafe void ViewStreamReadWithOffset () {
+                       var file = MemoryMappedFile.CreateFromFile (fname, FileMode.Open);
+                       var offset = 3;
+                       var expected = "lo!";
+
+                       using (var v = file.CreateViewStream (offset, expected.Length)) {
+                               Assert.AreEqual (offset, v.PointerOffset);
+
+                               var a = new byte [expected.Length];
+                               var n = v.Read (a, 0, expected.Length);
+                               Assert.AreEqual (expected.Length, n);
+                               var s = new string (Array.ConvertAll (a, b => (char)b));
+                               Assert.AreEqual (expected, s);
+                       }
+               }
 
                [Test]
                public void NamedMappingToInvalidFile ()
index 5f854fab2e5da2a584298c6da3f2814e46b3ac70..50c2f83271f8df98cb9d077aee786ff0b4d33ca4 100644 (file)
@@ -582,8 +582,10 @@ namespace MonoTests.System.Drawing{
             Font f1 = new Font("Arial", 8.25F, GraphicsUnit.Point);
             Font f2 = new Font("Courier New", 8.25F, GraphicsUnit.Point);
 
-            Assert.IsFalse(f1.GetHashCode() == f2.GetHashCode(),
-                "Hashcodes should differ if _name member differs");
+                       if (f1.Name != f2.Name) {
+                               Assert.IsFalse(f1.GetHashCode() == f2.GetHashCode(),
+                                                          "Hashcodes should differ if _name member differs");
+                       }
         }
 
         [Test]
index f0be3b0bc06132f34bd7b0794d5ca55acb467a1d..96af8c4131db2de4bf4b2d0d0b949f2ca6af6278 100644 (file)
@@ -2,6 +2,7 @@
 using System.Collections.Generic;
 using System.IO;
 using System.Linq;
+using System.Text;
 using SharpCompress.Common;
 
 namespace SharpCompress.Archive
@@ -105,11 +106,11 @@ namespace SharpCompress.Archive
             return false;
         }
 
-        public void SaveTo(Stream stream, CompressionInfo compressionType)
+        public void SaveTo(Stream stream, CompressionInfo compressionType, Encoding encoding = null)
         {
             //reset streams of new entries
             newEntries.Cast<IWritableArchiveEntry>().ForEach(x => x.Stream.Seek(0, SeekOrigin.Begin));
-            SaveTo(stream, compressionType, OldEntries, newEntries);
+            SaveTo(stream, compressionType, encoding ?? ArchiveEncoding.Default, OldEntries, newEntries);
         }
 
         protected TEntry CreateEntry(string key, Stream source, long size, DateTime? modified,
@@ -125,7 +126,7 @@ namespace SharpCompress.Archive
         protected abstract TEntry CreateEntryInternal(string key, Stream source, long size, DateTime? modified,
                                               bool closeStream);
 
-        protected abstract void SaveTo(Stream stream, CompressionInfo compressionType,
+        protected abstract void SaveTo(Stream stream, CompressionInfo compressionType, Encoding encoding,
                                        IEnumerable<TEntry> oldEntries, IEnumerable<TEntry> newEntries);
 
         public override void Dispose()
index 5c96e8e55543ff9600024a7fdacc1caac6ed210c..e2782dad9ec3ed05163b7cb99bc5af52f02a1f54 100644 (file)
@@ -2,6 +2,7 @@
 using System.Collections.Generic;
 using System.IO;
 using System.Linq;
+using System.Text;
 using SharpCompress.Common;
 using SharpCompress.Common.Zip;
 using SharpCompress.Common.Zip.Headers;
@@ -205,13 +206,13 @@ namespace SharpCompress.Archive.Zip
                     }
                 }
             }
-        }
+        }     
 
-        protected override void SaveTo(Stream stream, CompressionInfo compressionInfo,
+        protected override void SaveTo(Stream stream, CompressionInfo compressionInfo, Encoding encoding,
                                        IEnumerable<ZipArchiveEntry> oldEntries,
                                        IEnumerable<ZipArchiveEntry> newEntries)
         {
-            using (var writer = new ZipWriter(stream, compressionInfo, string.Empty))
+            using (var writer = new ZipWriter(stream, compressionInfo, string.Empty, encoding))
             {
                 foreach (var entry in oldEntries.Concat(newEntries)
                                                 .Where(x => !x.IsDirectory))
index 76a8853d0a05b03a39fdc4cec6eb4bb1e1a306ec..70a2eb7d8c4f103c144008895004176361d72d19 100644 (file)
@@ -30,16 +30,18 @@ namespace SharpCompress.Writer.Zip
 
         private readonly List<ZipCentralDirectoryEntry> entries = new List<ZipCentralDirectoryEntry>();
         private readonly string zipComment;
+        private readonly Encoding encoding;
         private long streamPosition;
 
 #if PPMd
         private readonly PpmdProperties ppmdProperties; // Caching properties to speed up PPMd.
 #endif
 
-        public ZipWriter(Stream destination, CompressionInfo compressionInfo, string zipComment)
+        public ZipWriter(Stream destination, CompressionInfo compressionInfo, string zipComment, Encoding encoding = null)
             : base(ArchiveType.Zip)
         {
             this.zipComment = zipComment ?? string.Empty;
+            this.encoding = encoding ?? ArchiveEncoding.Default;
 
             switch (compressionInfo.Type)
             {
@@ -137,11 +139,11 @@ namespace SharpCompress.Writer.Zip
 
         private int WriteHeader(string filename, DateTime? modificationTime)
         {
-            byte[] encodedFilename = Encoding.UTF8.GetBytes(filename);
+            byte[] encodedFilename = encoding.GetBytes(filename);
 
             OutputStream.Write(BitConverter.GetBytes(ZipHeaderFactory.ENTRY_HEADER_BYTES), 0, 4);
             OutputStream.Write(new byte[] {63, 0}, 0, 2); //version
-            HeaderFlags flags = HeaderFlags.UTF8;
+            HeaderFlags flags = encoding == Encoding.UTF8 ? HeaderFlags.UTF8 : (HeaderFlags)0;
             if (!OutputStream.CanSeek)
             {
                 flags |= HeaderFlags.UsePostDataDescriptor;
@@ -172,7 +174,7 @@ namespace SharpCompress.Writer.Zip
 
         private void WriteEndRecord(uint size)
         {
-            byte[] encodedComment = Encoding.UTF8.GetBytes(zipComment);
+            byte[] encodedComment = encoding.GetBytes(zipComment);
 
             OutputStream.Write(new byte[] {80, 75, 5, 6, 0, 0, 0, 0}, 0, 8);
             OutputStream.Write(BitConverter.GetBytes((ushort) entries.Count), 0, 2);
index feb5e1b705dec780327d9b62586094ac7bfc1faa..411aadc930f86c2c424f981fc12d0437a01862ca 100644 (file)
@@ -202,7 +202,7 @@ namespace System.IO.Compression
                private void Save()
                {
                        using (var newZip = new MemoryStream()) {
-                               zipFile.SaveTo(newZip, CompressionType.Deflate);
+                               zipFile.SaveTo(newZip, CompressionType.Deflate, entryNameEncoding ?? Encoding.UTF8);
 
                                stream.SetLength(0);
                                stream.Position = 0;
index ceddbfa125028204793ef5eb2a614c2e9a6d50ba..9ca277dbbcd3ed5f92ef9a04e09fa3b6b5cade31 100644 (file)
@@ -134,9 +134,11 @@ namespace System.Net.Http.Headers
                        this.HeaderKind = headerKind;
                }
 
-               public static HeaderInfo CreateSingle<T> (string name, TryParseDelegate<T> parser, HttpHeaderKind headerKind)
+               public static HeaderInfo CreateSingle<T> (string name, TryParseDelegate<T> parser, HttpHeaderKind headerKind, Func<object, string> toString = null)
                {
-                       return new HeaderTypeInfo<T, object> (name, parser, headerKind);
+                       return new HeaderTypeInfo<T, object> (name, parser, headerKind) {
+                               CustomToString = toString
+                       };
                }
 
                //
@@ -152,6 +154,10 @@ namespace System.Net.Http.Headers
                        return CreateCollection (headers, this);
                }
 
+               public Func<object, string> CustomToString {
+                       get; private set;
+               }
+
                public virtual string Separator {
                        get {
                                // Needed for AllowsMany only
index 8fdb011cd51fa6833db66e62c5f45ad0a32afd63..9a7248582a1a0ff88cb46cc9df3410785acc4551 100644 (file)
@@ -48,7 +48,7 @@ namespace System.Net.Http.Headers
 
                        public readonly Func<object, string> CustomToString;
 
-                       public HeaderBucket (object parsed, Func<object, string> converter = null)
+                       public HeaderBucket (object parsed, Func<object, string> converter)
                        {
                                this.Parsed = parsed;
                                this.CustomToString = converter;
@@ -104,18 +104,18 @@ namespace System.Net.Http.Headers
                                HeaderInfo.CreateSingle<byte[]> ("Content-MD5", Parser.MD5.TryParse, HttpHeaderKind.Content),
                                HeaderInfo.CreateSingle<ContentRangeHeaderValue> ("Content-Range", ContentRangeHeaderValue.TryParse, HttpHeaderKind.Content),
                                HeaderInfo.CreateSingle<MediaTypeHeaderValue> ("Content-Type", MediaTypeHeaderValue.TryParse, HttpHeaderKind.Content),
-                               HeaderInfo.CreateSingle<DateTimeOffset> ("Date", Parser.DateTime.TryParse, HttpHeaderKind.Request | HttpHeaderKind.Response),
+                               HeaderInfo.CreateSingle<DateTimeOffset> ("Date", Parser.DateTime.TryParse, HttpHeaderKind.Request | HttpHeaderKind.Response, Parser.DateTime.ToString),
                                HeaderInfo.CreateSingle<EntityTagHeaderValue> ("ETag", EntityTagHeaderValue.TryParse, HttpHeaderKind.Response),
                                HeaderInfo.CreateMulti<NameValueWithParametersHeaderValue> ("Expect", NameValueWithParametersHeaderValue.TryParse, HttpHeaderKind.Request),
-                               HeaderInfo.CreateSingle<DateTimeOffset> ("Expires", Parser.DateTime.TryParse, HttpHeaderKind.Content),
+                               HeaderInfo.CreateSingle<DateTimeOffset> ("Expires", Parser.DateTime.TryParse, HttpHeaderKind.Content, Parser.DateTime.ToString),
                                HeaderInfo.CreateSingle<string> ("From", Parser.EmailAddress.TryParse, HttpHeaderKind.Request),
                                HeaderInfo.CreateSingle<string> ("Host", Parser.Host.TryParse, HttpHeaderKind.Request),
                                HeaderInfo.CreateMulti<EntityTagHeaderValue> ("If-Match", EntityTagHeaderValue.TryParse, HttpHeaderKind.Request),
-                               HeaderInfo.CreateSingle<DateTimeOffset> ("If-Modified-Since", Parser.DateTime.TryParse, HttpHeaderKind.Request),
+                               HeaderInfo.CreateSingle<DateTimeOffset> ("If-Modified-Since", Parser.DateTime.TryParse, HttpHeaderKind.Request, Parser.DateTime.ToString),
                                HeaderInfo.CreateMulti<EntityTagHeaderValue> ("If-None-Match", EntityTagHeaderValue.TryParse, HttpHeaderKind.Request),
                                HeaderInfo.CreateSingle<RangeConditionHeaderValue> ("If-Range", RangeConditionHeaderValue.TryParse, HttpHeaderKind.Request),
-                               HeaderInfo.CreateSingle<DateTimeOffset> ("If-Unmodified-Since", Parser.DateTime.TryParse, HttpHeaderKind.Request),
-                               HeaderInfo.CreateSingle<DateTimeOffset> ("Last-Modified", Parser.DateTime.TryParse, HttpHeaderKind.Content),
+                               HeaderInfo.CreateSingle<DateTimeOffset> ("If-Unmodified-Since", Parser.DateTime.TryParse, HttpHeaderKind.Request, Parser.DateTime.ToString),
+                               HeaderInfo.CreateSingle<DateTimeOffset> ("Last-Modified", Parser.DateTime.TryParse, HttpHeaderKind.Content, Parser.DateTime.ToString),
                                HeaderInfo.CreateSingle<Uri> ("Location", Parser.Uri.TryParse, HttpHeaderKind.Response),
                                HeaderInfo.CreateSingle<int> ("Max-Forwards", Parser.Int.TryParse, HttpHeaderKind.Request),
                                HeaderInfo.CreateMulti<NameValueHeaderValue> ("Pragma", NameValueHeaderValue.TryParsePragma, HttpHeaderKind.Request | HttpHeaderKind.Response),
@@ -198,18 +198,18 @@ namespace System.Net.Http.Headers
 
                                        if (headerInfo.AllowsMany) {
                                                if (bucket == null)
-                                                       bucket = new HeaderBucket (headerInfo.CreateCollection (this));
+                                                       bucket = new HeaderBucket (headerInfo.CreateCollection (this), headerInfo.CustomToString);
 
                                                headerInfo.AddToCollection (bucket.Parsed, parsed_value);
                                        } else {
                                                if (bucket != null)
                                                        throw new FormatException ();
 
-                                               bucket = new HeaderBucket (parsed_value);
+                                               bucket = new HeaderBucket (parsed_value, headerInfo.CustomToString);
                                        }
                                } else {
                                        if (bucket == null)
-                                               bucket = new HeaderBucket (null);
+                                               bucket = new HeaderBucket (null, null);
 
                                        bucket.Values.Add (value ?? string.Empty);
                                }
@@ -466,7 +466,7 @@ namespace System.Net.Http.Headers
 
                        if (!headers.TryGetValue (name, out value)) {
                                var hinfo = known_headers[name];
-                               value = new HeaderBucket (new HttpHeaderValueCollection<T> (this, hinfo));
+                               value = new HeaderBucket (new HttpHeaderValueCollection<T> (this, hinfo), hinfo.CustomToString);
                                headers.Add (name, value);
                        }
 
index 513a21eb5db772564a9c6c7b3245f2bb0a38c4a9..5c23fc0b525b223eb9f16cb4ebf835ea0e3ac7c7 100644 (file)
@@ -340,6 +340,8 @@ namespace System.Net.Http
                                                        wrequest.ContentLength = content.Headers.ContentLength.Value;
                                                }
 
+                                               wrequest.ResendContentFactory = content.CopyTo;
+
                                                var stream = await wrequest.GetRequestStreamAsync ().ConfigureAwait (false);
                                                await request.Content.CopyToAsync (stream).ConfigureAwait (false);
                                        } else if (HttpMethod.Post.Equals (request.Method) || HttpMethod.Put.Equals (request.Method) || HttpMethod.Delete.Equals (request.Method)) {
index 344d87164eb1621a6d55bc6d67d03c3def40488b..df97dc50bbc11d7168206a84565ffb8321f9095e 100644 (file)
@@ -81,6 +81,12 @@ namespace System.Net.Http
                        }
                }
 
+               // Only used by HttpWebRequest internals which is not async friendly
+               internal void CopyTo (Stream stream)
+               {
+                       CopyToAsync (stream).Wait ();
+               }
+
                public Task CopyToAsync (Stream stream)
                {
                        return CopyToAsync (stream, null);
index 177df39d5b695e4a803d3676610aaf9f79b11cf7..9a1333cbb5db8a5b54400d94f458a989e503193a 100644 (file)
@@ -133,6 +133,16 @@ namespace MonoTests.System.Net.Http
                        Assert.AreEqual (other, m.First (), "#4");
                }
 
+               [Test]
+               public void Add_ParseCustomToString ()
+               {
+                       var m = new MultipartContent ("a", "b");
+
+                       m.Headers.Add ("Expires", "Mon,   30 Nov 2020   19:55:22    GMT");
+
+                       Assert.AreEqual ("Mon, 30 Nov 2020 19:55:22 GMT", m.Headers.Skip (1).First().Value.First ());
+               }
+
                [Test]
                public void Add_Resursive ()
                {
index b3e4a1c16dcf32f25e1e66d93c70ecb37699e7d9..d53c063441e031e840b38712192ef849e2c4bbae 100644 (file)
@@ -92,6 +92,8 @@ namespace System.Web.Routing
                        }
                }
 
+               public bool LowercaseUrls { get; set; }
+               public bool AppendTrailingSlash { get; set; }
                public bool RouteExistingFiles { get; set; }
 
                public void Add (string name, RouteBase item)
index 62eb0716440d75bdb62c0933c298994a2c61068f..a328b5e18fcbb139a2a26bbaaa0726f0bef4c426 100644 (file)
@@ -63,6 +63,7 @@ namespace System.Web.Configuration
                static ConfigurationProperty encoderTypeProp;
                static ConfigurationProperty relaxedUrlToFileSystemMappingProp;
                static ConfigurationProperty targetFrameworkProp;
+               static ConfigurationProperty allowDynamicModuleRegistrationProp;
                static ConfigurationPropertyCollection properties;
 
                static HttpRuntimeSection ()
@@ -141,6 +142,8 @@ namespace System.Web.Configuration
                                                                                PropertyHelper.VersionConverter,
                                                                                PropertyHelper.DefaultValidator,
                                                                                ConfigurationPropertyOptions.None);
+                       allowDynamicModuleRegistrationProp = new ConfigurationProperty ("allowDynamicModuleRegistration", typeof(bool), true,
+                                                                               ConfigurationPropertyOptions.None);
                        
                        properties = new ConfigurationPropertyCollection();
                        properties.Add (apartmentThreadingProp);
@@ -169,6 +172,7 @@ namespace System.Web.Configuration
                        properties.Add (encoderTypeProp);
                        properties.Add (relaxedUrlToFileSystemMappingProp);
                        properties.Add (targetFrameworkProp);
+                       properties.Add (allowDynamicModuleRegistrationProp);
                }
 
                public HttpRuntimeSection()
@@ -349,6 +353,11 @@ namespace System.Web.Configuration
                protected internal override ConfigurationPropertyCollection Properties {
                        get { return properties; }
                }
+               [ConfigurationProperty ("allowDynamicModuleRegistration", DefaultValue = "True")]
+               public bool AllowDynamicModuleRegistration {
+                       get { return (bool) base [allowDynamicModuleRegistrationProp]; }
+                       set { base [allowDynamicModuleRegistrationProp] = value; }
+               }
        }
 }
 
index ebf540bfb924df4dc2192c8277913ed9698f8fe0..4b8a52f036de2deb44f292da94fd47541e04a425 100644 (file)
@@ -104,6 +104,13 @@ namespace System.Web.Hosting {
                        get { return vpath_provider; }
                }
 
+               public static bool InClientBuildManager {
+                       get {
+                               // Mono doesn't have a ClientBuildManager, so we can't be in it. Simple as that.
+                               return false;
+                       }
+               }
+
                public static void DecrementBusyCount ()
                {
                        Interlocked.Decrement (ref busy_count);
diff --git a/mcs/class/System.Web/System.Web/DynamicModuleManager.cs b/mcs/class/System.Web/System.Web/DynamicModuleManager.cs
new file mode 100644 (file)
index 0000000..99e0a36
--- /dev/null
@@ -0,0 +1,57 @@
+//
+// DynamicModuleManager.cs: Manager for dynamic Http Modules.
+//
+// Author:
+//   Matthias Bogad (bogad@cs.tum.edu)
+//
+// (C) 2015
+//
+
+using System;
+using System.Collections.Generic;
+
+namespace System.Web {
+       sealed class DynamicModuleManager {
+               const string moduleNameFormat = "__Module__{0}_{1}";
+       
+               readonly List<DynamicModuleInfo> entries = new List<DynamicModuleInfo> ();
+               bool entriesAreReadOnly = false;
+               readonly object mutex = new object ();
+               
+               public void Add (Type moduleType) 
+               {
+                       if (moduleType == null)
+                               throw new ArgumentException ("moduleType");
+                       
+                       if (!typeof (IHttpModule).IsAssignableFrom (moduleType))
+                               throw new ArgumentException ("Given object does not implement IHttpModule.", "moduleType");
+                       
+                       lock (mutex) {
+                               if (entriesAreReadOnly)
+                                       throw new InvalidOperationException ("A module was to be added to the dynamic module list, but the list was already initialized. The dynamic module list can only be initialized once.");
+
+                               entries.Add (new DynamicModuleInfo (moduleType,
+                                                       string.Format (moduleNameFormat, moduleType.AssemblyQualifiedName, Guid.NewGuid ())));
+                       }
+               }
+               
+               public ICollection<DynamicModuleInfo> LockAndGetModules ()
+               {
+                       lock (mutex) {
+                               entriesAreReadOnly = true;
+                               return entries;
+                       }
+               }
+       }
+
+       struct DynamicModuleInfo {
+               public readonly string Name;
+               public readonly Type Type;
+
+               public DynamicModuleInfo (Type type, string name)
+               {
+                       Name = name;
+                       Type = type;
+               }
+       }
+}
index 68c098dcc261c264a2237318072781429e24192b..34c2d105769aa4f5623694fd0d1d903d48c81039 100644 (file)
@@ -4,7 +4,8 @@
 // Author:
 //     Miguel de Icaza (miguel@novell.com)
 //     Gonzalo Paniagua (gonzalo@ximian.com)
-//    
+//     Matthias Bogad (bogad@cs.tum.edu)
+//
 //
 // Copyright (C) 2005-2009 Novell, Inc (http://www.novell.com)
 //
 //    Events Disposed
 //
 
+using System;
 using System.IO;
 using System.Collections;
+using System.Collections.Generic;
 using System.ComponentModel;
 using System.Configuration;
 using System.Diagnostics;
@@ -162,6 +165,8 @@ namespace System.Web
                bool removeConfigurationFromCache;
                bool fullInitComplete = false;
                
+               static DynamicModuleManager dynamicModuleManeger = new DynamicModuleManager ();
+
                //
                // These are used to detect the case where the EndXXX method is invoked
                // from within the BeginXXXX delegate, so we detect whether we kick the
@@ -209,6 +214,13 @@ namespace System.Web
                                        if (context == null)
                                                context = HttpContext.Current;
                                        HttpModuleCollection coll = modules.LoadModules (this);
+
+                                       HttpModuleCollection dynMods = CreateDynamicModules ();
+
+                                       for (int i = 0; i < dynMods.Count; i++) {
+                                               coll.AddModule (dynMods.GetKey (i), dynMods.Get (i));
+                                       }
+
                                        Interlocked.CompareExchange (ref modcoll, coll, null);
                                        HttpContext.Current = saved;
 
@@ -404,7 +416,7 @@ namespace System.Web
                
                public void AddOnAcquireRequestStateAsync (BeginEventHandler bh, EndEventHandler eh)
                {
-                       AsyncInvoker invoker = new AsyncInvoker (bh, eh);
+                       AsyncInvoker invoker = new AsyncInvoker (bh, eh, this);
                        AcquireRequestState += new EventHandler (invoker.Invoke);
                }
 
@@ -417,7 +429,7 @@ namespace System.Web
                
                public void AddOnAuthenticateRequestAsync (BeginEventHandler bh, EndEventHandler eh)
                {
-                       AsyncInvoker invoker = new AsyncInvoker (bh, eh);
+                       AsyncInvoker invoker = new AsyncInvoker (bh, eh, this);
                        AuthenticateRequest += new EventHandler (invoker.Invoke);
                }
 
@@ -430,7 +442,7 @@ namespace System.Web
                
                public void AddOnAuthorizeRequestAsync (BeginEventHandler bh, EndEventHandler eh)
                {
-                       AsyncInvoker invoker = new AsyncInvoker (bh, eh);
+                       AsyncInvoker invoker = new AsyncInvoker (bh, eh, this);
                        AuthorizeRequest += new EventHandler (invoker.Invoke);
                }
 
@@ -452,7 +464,7 @@ namespace System.Web
                
                public void AddOnBeginRequestAsync (BeginEventHandler bh, EndEventHandler eh)
                {
-                       AsyncInvoker invoker = new AsyncInvoker (bh, eh);
+                       AsyncInvoker invoker = new AsyncInvoker (bh, eh, this);
                        BeginRequest += new EventHandler (invoker.Invoke);
                }
 
@@ -474,7 +486,7 @@ namespace System.Web
                
                public void AddOnEndRequestAsync (BeginEventHandler bh, EndEventHandler eh)
                {
-                       AsyncInvoker invoker = new AsyncInvoker (bh, eh);
+                       AsyncInvoker invoker = new AsyncInvoker (bh, eh, this);
                        EndRequest += new EventHandler (invoker.Invoke);
                }
 
@@ -487,7 +499,7 @@ namespace System.Web
                
                public void AddOnPostRequestHandlerExecuteAsync (BeginEventHandler bh, EndEventHandler eh)
                {
-                       AsyncInvoker invoker = new AsyncInvoker (bh, eh);
+                       AsyncInvoker invoker = new AsyncInvoker (bh, eh, this);
                        PostRequestHandlerExecute += new EventHandler (invoker.Invoke);
                }
 
@@ -500,7 +512,7 @@ namespace System.Web
                
                public void AddOnPreRequestHandlerExecuteAsync (BeginEventHandler bh, EndEventHandler eh)
                {
-                       AsyncInvoker invoker = new AsyncInvoker (bh, eh);
+                       AsyncInvoker invoker = new AsyncInvoker (bh, eh, this);
                        PreRequestHandlerExecute += new EventHandler (invoker.Invoke);
                }
 
@@ -513,7 +525,7 @@ namespace System.Web
                
                public void AddOnReleaseRequestStateAsync (BeginEventHandler bh, EndEventHandler eh)
                {
-                       AsyncInvoker invoker = new AsyncInvoker (bh, eh);
+                       AsyncInvoker invoker = new AsyncInvoker (bh, eh, this);
                        ReleaseRequestState += new EventHandler (invoker.Invoke);
                }
 
@@ -526,7 +538,7 @@ namespace System.Web
                
                public void AddOnResolveRequestCacheAsync (BeginEventHandler bh, EndEventHandler eh)
                {
-                       AsyncInvoker invoker = new AsyncInvoker (bh, eh);
+                       AsyncInvoker invoker = new AsyncInvoker (bh, eh, this);
                        ResolveRequestCache += new EventHandler (invoker.Invoke);
                }
 
@@ -539,7 +551,7 @@ namespace System.Web
                
                public void AddOnUpdateRequestCacheAsync (BeginEventHandler bh, EndEventHandler eh)
                {
-                       AsyncInvoker invoker = new AsyncInvoker (bh, eh);
+                       AsyncInvoker invoker = new AsyncInvoker (bh, eh, this);
                        UpdateRequestCache += new EventHandler (invoker.Invoke);
                }
 
@@ -557,7 +569,7 @@ namespace System.Web
                        
                public void AddOnPostAuthenticateRequestAsync (BeginEventHandler bh, EndEventHandler eh, object data)
                {
-                       AsyncInvoker invoker = new AsyncInvoker (bh, eh, data);
+                       AsyncInvoker invoker = new AsyncInvoker (bh, eh, this, data);
                        PostAuthenticateRequest += new EventHandler (invoker.Invoke);
                }
 
@@ -575,7 +587,7 @@ namespace System.Web
                
                public void AddOnPostAuthorizeRequestAsync (BeginEventHandler bh, EndEventHandler eh, object data)
                {
-                       AsyncInvoker invoker = new AsyncInvoker (bh, eh, data);
+                       AsyncInvoker invoker = new AsyncInvoker (bh, eh, this, data);
                        PostAuthorizeRequest += new EventHandler (invoker.Invoke);
                }
                
@@ -593,7 +605,7 @@ namespace System.Web
                
                public void AddOnPostResolveRequestCacheAsync (BeginEventHandler bh, EndEventHandler eh, object data)
                {
-                       AsyncInvoker invoker = new AsyncInvoker (bh, eh, data);
+                       AsyncInvoker invoker = new AsyncInvoker (bh, eh, this, data);
                        PostResolveRequestCache += new EventHandler (invoker.Invoke);
                }
 
@@ -611,7 +623,7 @@ namespace System.Web
                
                public void AddOnPostMapRequestHandlerAsync (BeginEventHandler bh, EndEventHandler eh, object data)
                {
-                       AsyncInvoker invoker = new AsyncInvoker (bh, eh, data);
+                       AsyncInvoker invoker = new AsyncInvoker (bh, eh, this, data);
                        PostMapRequestHandler += new EventHandler (invoker.Invoke);
                }
 
@@ -629,7 +641,7 @@ namespace System.Web
                
                public void AddOnPostAcquireRequestStateAsync (BeginEventHandler bh, EndEventHandler eh, object data)
                {
-                       AsyncInvoker invoker = new AsyncInvoker (bh, eh, data);
+                       AsyncInvoker invoker = new AsyncInvoker (bh, eh, this, data);
                        PostAcquireRequestState += new EventHandler (invoker.Invoke);
                }
 
@@ -647,7 +659,7 @@ namespace System.Web
                
                public void AddOnPostReleaseRequestStateAsync (BeginEventHandler bh, EndEventHandler eh, object data)
                {
-                       AsyncInvoker invoker = new AsyncInvoker (bh, eh, data);
+                       AsyncInvoker invoker = new AsyncInvoker (bh, eh, this, data);
                        PostReleaseRequestState += new EventHandler (invoker.Invoke);
                }
 
@@ -665,7 +677,7 @@ namespace System.Web
                
                public void AddOnPostUpdateRequestCacheAsync (BeginEventHandler bh, EndEventHandler eh, object data)
                {
-                       AsyncInvoker invoker = new AsyncInvoker (bh, eh, data);
+                       AsyncInvoker invoker = new AsyncInvoker (bh, eh, this, data);
                        PostUpdateRequestCache += new EventHandler (invoker.Invoke);
                }
 
@@ -674,61 +686,61 @@ namespace System.Web
                //
                public void AddOnAcquireRequestStateAsync (BeginEventHandler bh, EndEventHandler eh, object data)
                {
-                       AsyncInvoker invoker = new AsyncInvoker (bh, eh, data);
+                       AsyncInvoker invoker = new AsyncInvoker (bh, eh, this, data);
                        AcquireRequestState += new EventHandler (invoker.Invoke);
                }
 
                public void AddOnAuthenticateRequestAsync (BeginEventHandler bh, EndEventHandler eh, object data)
                {
-                       AsyncInvoker invoker = new AsyncInvoker (bh, eh, data);
+                       AsyncInvoker invoker = new AsyncInvoker (bh, eh, this, data);
                        AuthenticateRequest += new EventHandler (invoker.Invoke);
                }
 
                public void AddOnAuthorizeRequestAsync (BeginEventHandler bh, EndEventHandler eh, object data)
                {
-                       AsyncInvoker invoker = new AsyncInvoker (bh, eh, data);
+                       AsyncInvoker invoker = new AsyncInvoker (bh, eh, this, data);
                        AuthorizeRequest += new EventHandler (invoker.Invoke);
                }
 
                public void AddOnBeginRequestAsync (BeginEventHandler bh, EndEventHandler eh, object data)
                {
-                       AsyncInvoker invoker = new AsyncInvoker (bh, eh, data);
+                       AsyncInvoker invoker = new AsyncInvoker (bh, eh, this, data);
                        BeginRequest += new EventHandler (invoker.Invoke);
                }
 
                public void AddOnEndRequestAsync (BeginEventHandler bh, EndEventHandler eh, object data)
                {
-                       AsyncInvoker invoker = new AsyncInvoker (bh, eh, data);
+                       AsyncInvoker invoker = new AsyncInvoker (bh, eh, this, data);
                        EndRequest += new EventHandler (invoker.Invoke);
                }
                
                public void AddOnPostRequestHandlerExecuteAsync (BeginEventHandler bh, EndEventHandler eh, object data)
                {
-                       AsyncInvoker invoker = new AsyncInvoker (bh, eh, data);
+                       AsyncInvoker invoker = new AsyncInvoker (bh, eh, this, data);
                        PostRequestHandlerExecute += new EventHandler (invoker.Invoke);
                }
 
                public void AddOnPreRequestHandlerExecuteAsync (BeginEventHandler bh, EndEventHandler eh, object data)
                {
-                       AsyncInvoker invoker = new AsyncInvoker (bh, eh, data);
+                       AsyncInvoker invoker = new AsyncInvoker (bh, eh, this, data);
                        PreRequestHandlerExecute += new EventHandler (invoker.Invoke);
                }
 
                public void AddOnReleaseRequestStateAsync (BeginEventHandler bh, EndEventHandler eh, object data)
                {
-                       AsyncInvoker invoker = new AsyncInvoker (bh, eh, data);
+                       AsyncInvoker invoker = new AsyncInvoker (bh, eh, this, data);
                        ReleaseRequestState += new EventHandler (invoker.Invoke);
                }
 
                public void AddOnResolveRequestCacheAsync (BeginEventHandler bh, EndEventHandler eh, object data)
                {
-                       AsyncInvoker invoker = new AsyncInvoker (bh, eh, data);
+                       AsyncInvoker invoker = new AsyncInvoker (bh, eh, this, data);
                        ResolveRequestCache += new EventHandler (invoker.Invoke);
                }
 
                public void AddOnUpdateRequestCacheAsync (BeginEventHandler bh, EndEventHandler eh, object data)
                {
-                       AsyncInvoker invoker = new AsyncInvoker (bh, eh, data);
+                       AsyncInvoker invoker = new AsyncInvoker (bh, eh, this, data);
                        UpdateRequestCache += new EventHandler (invoker.Invoke);
                }
 
@@ -749,7 +761,7 @@ namespace System.Web
                
                public void AddOnLogRequestAsync (BeginEventHandler beginHandler, EndEventHandler endHandler, object state)
                {
-                       AsyncInvoker invoker = new AsyncInvoker (beginHandler, endHandler, state);
+                       AsyncInvoker invoker = new AsyncInvoker (beginHandler, endHandler, this, state);
                        LogRequest += new EventHandler (invoker.Invoke);
                }
 
@@ -767,7 +779,7 @@ namespace System.Web
 
                public void AddOnMapRequestHandlerAsync (BeginEventHandler beginHandler, EndEventHandler endHandler, object state)
                {
-                       AsyncInvoker invoker = new AsyncInvoker (beginHandler, endHandler, state);
+                       AsyncInvoker invoker = new AsyncInvoker (beginHandler, endHandler, this, state);
                        MapRequestHandler += new EventHandler (invoker.Invoke);
                }
 
@@ -785,7 +797,7 @@ namespace System.Web
 
                public void AddOnPostLogRequestAsync (BeginEventHandler beginHandler, EndEventHandler endHandler, object state)
                {
-                       AsyncInvoker invoker = new AsyncInvoker (beginHandler, endHandler, state);
+                       AsyncInvoker invoker = new AsyncInvoker (beginHandler, endHandler, this, state);
                        PostLogRequest += new EventHandler (invoker.Invoke);
                }
                
@@ -871,7 +883,7 @@ namespace System.Web
                //
                // If we catch an error, queue this error
                //
-               void ProcessError (Exception e)
+               internal void ProcessError (Exception e)
                {
                        bool first = context.Error == null;
                        context.AddError (e);
@@ -1643,7 +1655,39 @@ namespace System.Web
                                return true;
                        }
                }
-               
+
+               public static void RegisterModule (Type moduleType) 
+               {
+                       HttpRuntimeSection config = (HttpRuntimeSection)WebConfigurationManager.GetSection ("system.web/httpRuntime");
+
+                       if (!config.AllowDynamicModuleRegistration)
+                               throw new InvalidOperationException ("The Application has requested to register a dynamic Module, but dynamic module registration is disabled in web.config.");
+
+                       dynamicModuleManeger.Add (moduleType);
+               }
+
+
+               HttpModuleCollection CreateDynamicModules () 
+               {
+                       HttpModuleCollection modules = new HttpModuleCollection ();
+
+                       foreach (var module in dynamicModuleManeger.LockAndGetModules ()) {
+                               IHttpModule httpModule = CreateModuleInstance (module.Type);
+                               httpModule.Init (this);
+                               modules.AddModule (module.Name, httpModule);
+                       }
+                       return modules;
+               }
+
+               IHttpModule CreateModuleInstance (Type type)
+               {
+                       return (IHttpModule) Activator.CreateInstance (type,
+                                       BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.CreateInstance,
+                                       null,
+                                       null,
+                                       null);
+               }
+
 #region internals
                internal void ClearError ()
                {
@@ -1891,24 +1935,40 @@ namespace System.Web
                public BeginEventHandler begin;
                public EndEventHandler end;
                public object data;
+               HttpApplication app;
+               AsyncCallback callback;
                
-               public AsyncInvoker (BeginEventHandler bh, EndEventHandler eh, object d)
+               public AsyncInvoker (BeginEventHandler bh, EndEventHandler eh, HttpApplication a, object d)
                {
                        begin = bh;
                        end = eh;
                        data = d;
+                       app = a;
+                       callback = new AsyncCallback (doAsyncCallback);
                }
 
-               public AsyncInvoker (BeginEventHandler bh, EndEventHandler eh)
-               {
-                       begin = bh;
-                       end = eh;
-               }
+               public AsyncInvoker (BeginEventHandler bh, EndEventHandler eh, HttpApplication app) : this(bh, eh, app, null) { }
                
                public void Invoke (object sender, EventArgs e)
                {
-                       throw new Exception ("This is just a dummy");
+                       IAsyncResult res;
+                       res = begin (app, e, callback, data);
+               }
+
+               void doAsyncCallback (IAsyncResult res)
+               {
+                       ThreadPool.QueueUserWorkItem ((object ores) => {
+                               IAsyncResult tres = (IAsyncResult) ores;
+                               try {
+                                       end (tres);
+                               } catch (Exception ee) {
+                                       // I tried using ProcessError(), but we only come here frome an Invokation in PipelineDone().
+                                       // Using ProcessError, I still get a blank screen, this way, we at least log the error to console...
+                                       Console.Error.WriteLine (ee.ToString ());
+                               }
+                       }, res);
                }
        }
 #endregion
 }
+
index 8703eb00471f39775bcb5413a53b6d75c187bdd1..b074ec8f0a8cb9c7b928f59b9cddbeeb7c8a5044 100644 (file)
@@ -10,3 +10,4 @@ System.Web/UnvalidatedRequestValuesWrapper.cs
 System.Web/TaskAsyncResult.cs
 System.Web/TaskEventHandler.cs
 System.Web.Security/MembershipPasswordAttribute.cs
+System.Web/DynamicModuleManager.cs
index 10367320015607cdb8452069ec55294616e27512..54cd8471352f2f1c9ea6a643504f3dabec99775c 100644 (file)
@@ -64,3 +64,7 @@ using System.Runtime.InteropServices;
 #endif
 
 [assembly: ComVisible (false)]
+
+#if !MOBILE
+[assembly: TypeForwardedTo (typeof (System.Windows.Markup.ValueSerializerAttribute))]
+#endif
index 73a01bf9ff6ed4195a9938a57bd2cbfce0bf8182..b3b5cbf3da3d86e1e3c869bab36dcda77c385453 100644 (file)
@@ -1603,20 +1603,9 @@ namespace System.Diagnostics {
                                                if (async_error != null)
                                                        async_error.Close ();
 
-                                               if (input_stream != null) {
-                                                       input_stream.Close();
-                                                       input_stream = null;
-                                               }
-
-                                               if (output_stream != null) {
-                                                       output_stream.Close();
-                                                       output_stream = null;
-                                               }
-
-                                               if (error_stream != null) {
-                                                       error_stream.Close();
-                                                       error_stream = null;
-                                               }
+                                               input_stream = null;
+                                               output_stream = null;
+                                               error_stream = null;
                                        }
                                }
                                
index 2eb2cd34a53cbf4051c279acc2696a3e4d740f45..27f61b35d0ea775478f504f0b288e67620fa7559 100644 (file)
@@ -274,7 +274,6 @@ namespace System.IO {
                                        started = false;
                                        inDispatch = false;
                                        fsw.EnableRaisingEvents = false;
-                                       throw exc;
                                }
                                if (exc != null)
                                        fsw.DispatchErrorEvents (new ErrorEventArgs (exc));
@@ -373,6 +372,11 @@ namespace System.IO {
 
                                for (var i = 0; i < numEvents; i++) {
                                        var kevt = eventBuffer [i];
+
+                                       if (!fdsDict.ContainsKey ((int)kevt.ident))
+                                               // The event is for a file that was removed
+                                               continue;
+
                                        var pathData = fdsDict [(int)kevt.ident];
 
                                        if ((kevt.flags & EventFlags.Error) == EventFlags.Error) {
@@ -382,6 +386,10 @@ namespace System.IO {
                                        }
                                                
                                        if ((kevt.fflags & FilterFlags.VNodeDelete) == FilterFlags.VNodeDelete || (kevt.fflags & FilterFlags.VNodeRevoke) == FilterFlags.VNodeRevoke) {
+                                               if (pathData.Path == fullPathNoLastSlash)
+                                                       // The root path is deleted; exit silently
+                                                       return;
+                                                               
                                                removeQueue.Add (pathData);
                                                continue;
                                        }
index 7ccbcc2f34e104f80fadfedc6a3dbe262d13e073..b9cc121d03c7f6dc1455782f6dbf692a96539330 100644 (file)
@@ -110,6 +110,9 @@ namespace System.Net
                AuthorizationState auth_state, proxy_auth_state;
                string host;
 
+               [NonSerialized]
+               internal Action<Stream> ResendContentFactory;
+
                // Constructors
                static HttpWebRequest ()
                {
@@ -226,9 +229,15 @@ namespace System.Net
                
                internal bool InternalAllowBuffering {
                        get {
-                               return (allowBuffering && (method != "HEAD" && method != "GET" &&
-                                                       method != "MKCOL" && method != "CONNECT" &&
-                                                       method != "TRACE"));
+                               return allowBuffering && MethodWithBuffer;
+                       }
+               }
+
+               bool MethodWithBuffer {
+                       get {
+                               return method != "HEAD" && method != "GET" &&
+                               method != "MKCOL" && method != "CONNECT" &&
+                               method != "TRACE";
                        }
                }
                
@@ -1101,7 +1110,7 @@ namespace System.Net
                        if (e != null)
                                throw e;
 
-                       if (AllowWriteStreamBuffering)
+                       if (AllowWriteStreamBuffering || method == "GET")
                                contentLength = -1;
 
                        uriString = webResponse.Headers ["Location"];
@@ -1306,8 +1315,7 @@ namespace System.Net
                                                bodyBuffer = null;
                                                writeStream.Close ();
                                        }
-                               } else if (method != "HEAD" && method != "GET" && method != "MKCOL" && method != "CONNECT" &&
-                                         method != "TRACE") {
+                               } else if (MethodWithBuffer) {
                                        if (getResponseCalled && !writeStream.RequestWritten)
                                                return writeStream.WriteRequestAsync (result);
                                }
@@ -1606,12 +1614,28 @@ namespace System.Net
                                        (ProxyQuery && !proxy_auth_state.IsCompleted && code == HttpStatusCode.ProxyAuthenticationRequired)) {
                                        if (!usedPreAuth && CheckAuthorization (webResponse, code)) {
                                                // Keep the written body, so it can be rewritten in the retry
-                                               if (InternalAllowBuffering) {
-                                                       if (writeStream.WriteBufferLength > 0) {
-                                                               bodyBuffer = writeStream.WriteBuffer;
-                                                               bodyBufferLength = writeStream.WriteBufferLength;
+                                               if (MethodWithBuffer) {
+                                                       if (AllowWriteStreamBuffering) {
+                                                               if (writeStream.WriteBufferLength > 0) {
+                                                                       bodyBuffer = writeStream.WriteBuffer;
+                                                                       bodyBufferLength = writeStream.WriteBufferLength;
+                                                               }
+
+                                                               return true;
+                                                       }
+
+                                                       //
+                                                       // Buffering is not allowed but we have alternative way to get same content (we
+                                                       // need to resent it due to NTLM Authentication).
+                                                       //
+                                                       if (ResendContentFactory != null) {
+                                                               using (var ms = new MemoryStream ()) {
+                                                                       ResendContentFactory (ms);
+                                                                       bodyBuffer = ms.ToArray ();
+                                                                       bodyBufferLength = bodyBuffer.Length;
+                                                               }
+                                                               return true;
                                                        }
-                                                       return true;
                                                } else if (method != "PUT" && method != "POST") {
                                                        bodyBuffer = null;
                                                        return true;
index f7d6843d2b5dbecd5f4cfba9c6ea3b54f98fd88a..23019e0332a9f9ca4354efe935287306aa73b54b 100644 (file)
@@ -909,5 +909,19 @@ namespace MonoTests.System.Diagnostics
                public void HasExitedCurrent () {
                        Assert.IsFalse (Process.GetCurrentProcess ().HasExited);
                }
+
+               [Test]
+               public void DisposeWithDisposedStreams ()
+               {
+                       var psi = GetCrossPlatformStartInfo ();
+                       psi.RedirectStandardInput = true;
+                       psi.RedirectStandardOutput = true;
+                       psi.UseShellExecute = false;
+
+                       var p = Process.Start (psi);
+                       p.StandardInput.BaseStream.Dispose ();
+                       p.StandardOutput.BaseStream.Dispose ();
+                       p.Dispose ();
+               }
        }
 }
index 0fcb525847a7ab61353a2dabd931579a0f654d34..c4e3e4a1ad424e6daf365c25f68b717b0b17af3a 100644 (file)
@@ -350,7 +350,7 @@ System.Runtime.InteropServices/HandleCollector.cs
 System.Windows.Input/ICommand.cs
 
 ReferenceSources/AssertWrapper.cs
-ReferenceSource/HttpSysSettings.cs
+ReferenceSources/HttpSysSettings.cs
 ReferenceSources/Logging.cs
 ReferenceSources/NativeMethods.cs
 ReferenceSources/SettingsSectionInternal.cs
index 35f3685cc0aa52c0fb7d8fd87f81ef70b0550ffd..02780da33bf225a57be55861d62188518273f79b 100644 (file)
@@ -38,9 +38,6 @@ using System.Runtime.CompilerServices;
 using System.Runtime.InteropServices;
 using System.Windows.Markup;
 
-// General Information about the WindowsBase assembly
-// v3.0 Assembly
-
 [assembly: AssemblyCompany (Consts.MonoCompany)]
 [assembly: AssemblyProduct (Consts.MonoProduct)]
 [assembly: AssemblyCopyright (Consts.MonoCopyright)]
@@ -78,3 +75,8 @@ using System.Windows.Markup;
 [assembly: XmlnsDefinitionAttribute ("http://schemas.microsoft.com/netfx/2007/xaml/presentation", "System.Windows.Input")]
 [assembly: XmlnsDefinitionAttribute ("http://schemas.microsoft.com/netfx/2007/xaml/presentation", "System.Windows")]
 [assembly: XmlnsDefinitionAttribute ("http://schemas.microsoft.com/netfx/2007/xaml/presentation", "System.Diagnostics")]
+
+#if !MOBILE
+[assembly: TypeForwardedTo (typeof (ValueSerializerAttribute))]
+#endif
+
index 8f52497add35801e6c6adfa59d493f1323fcf959..40586b76082002f02d8b54952681a89c926b30ae 100644 (file)
@@ -11,7 +11,7 @@ LIB_MCS_FLAGS = $(REFERENCE_SOURCES_FLAGS) $(RESOURCE_FILES:%=-resource:%)
 #LIBRARY_USE_INTERMEDIATE_FILE = yes
 
 ifeq (2, $(FRAMEWORK_VERSION_MAJOR))
-LIB_MCS_FLAGS += --runtime:v2
+LIB_MCS_FLAGS += --runtime:v4
 else
 ifeq (4, $(FRAMEWORK_VERSION_MAJOR))
 LIB_MCS_FLAGS += --runtime:v4
@@ -174,9 +174,9 @@ EXTRA_DISTFILES += \
 
 TMP_FILE1=tzi1.tmp
 TMP_FILE2=tzi2.tmp
-       
+
+# Remove some code that is protected so we don't have to include all the corlib files.
 tzi.exe:System/AndroidPlatform.cs $(wildcard System/TimeZone*.cs) ../../build/common/Consts.cs ../../build/common/Locale.cs ../Mono.Options/Mono.Options/Options.cs
-       # Remove some code that is protected so we don't have to include all the corlib files.
        trap "rm -f $(TMP_FILE1) $(TMP_FILE2)" EXIT INT QUIT TERM && \
        sed 's/Environment\.GetResourceString/string.Format/g' ../../../external/referencesource/mscorlib/system/timezoneinfo.cs > $(TMP_FILE1) && \
        sed 's/StringBuilder\.DefaultCapacity/100/g' ../../../external/referencesource/mscorlib/system/text/stringbuildercache.cs > $(TMP_FILE2) && \
diff --git a/mcs/class/corlib/System.IO/UnmanagedMemoryAccessor.cs b/mcs/class/corlib/System.IO/UnmanagedMemoryAccessor.cs
deleted file mode 100644 (file)
index feb7b4a..0000000
+++ /dev/null
@@ -1,477 +0,0 @@
-//
-// System.IO.UnmanagedMemoryAccessor.cs
-//
-// Author:
-//  Zoltan Varga (vargaz@gmail.com)
-//  Marek Safar (marek.safar@gmail.com)
-//
-// Copyright (C) 2009 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-using System;
-using System.Runtime.InteropServices;
-using System.Security.Permissions;
-
-namespace System.IO
-{
-       [MonoTODO ("Offset is ignored")]
-       public class UnmanagedMemoryAccessor : IDisposable {
-               SafeBuffer buffer;
-#pragma warning disable 414
-               long offset;
-#pragma warning restore
-               long capacity;
-               bool canwrite, canread;
-
-               protected UnmanagedMemoryAccessor ()
-               {
-               }
-
-               public UnmanagedMemoryAccessor (SafeBuffer buffer, long offset, long capacity)
-               {
-                       Initialize (buffer, offset, capacity, FileAccess.ReadWrite);
-               }
-
-               public UnmanagedMemoryAccessor (SafeBuffer buffer, long offset, long capacity, FileAccess access)
-               {
-                       Initialize (buffer, offset, capacity, access);
-               }
-
-               [SecurityPermissionAttribute(SecurityAction.Demand, Flags = SecurityPermissionFlag.UnmanagedCode)]
-               protected void Initialize(SafeBuffer buffer, long offset, long capacity, FileAccess access)
-               {
-                       if (buffer == null)
-                               throw new ArgumentNullException ("buffer");
-                       if (offset < 0)
-                               throw new ArgumentOutOfRangeException ("offset");
-                       if (capacity < 0)
-                               throw new ArgumentOutOfRangeException ("capacity");
-
-                       if (access == FileAccess.Read || access == FileAccess.ReadWrite)
-                               canread = true;
-                       if (access == FileAccess.Write || access == FileAccess.ReadWrite)
-                               canwrite = true;
-
-                       if (this.buffer != null)
-                               Dispose (true);
-                                        
-                       this.buffer = buffer;
-                       this.offset = offset;
-                       this.capacity = capacity;
-               }
-               
-               public void Dispose ()
-               {
-                       Dispose (true);
-                       GC.SuppressFinalize (this);
-               }
-
-               protected virtual void Dispose (bool disposing)
-               {
-                       if (buffer != null){
-                               if (disposing){
-                                       buffer.Dispose ();
-                               }
-                       }
-                       buffer = null;
-               }
-
-               public byte ReadByte (long position) 
-               {
-                       if (!canread)
-                               throw new NotSupportedException ();
-                       if (buffer == null)
-                               throw new ObjectDisposedException ("buffer");
-                       if (position < 0)
-                               throw new ArgumentOutOfRangeException ();
-                       
-                       return buffer.Read<byte> ((ulong) position);
-               }
-
-               public bool ReadBoolean (long position) 
-               {
-                       if (!canread)
-                               throw new NotSupportedException ();
-                       if (buffer == null)
-                               throw new ObjectDisposedException ("buffer");
-                       if (position < 0)
-                               throw new ArgumentOutOfRangeException ();
-                       
-                       return buffer.Read<bool> ((ulong) position);
-               }
-
-               public char ReadChar (long position) 
-               {
-                       if (!canread)
-                               throw new NotSupportedException ();
-                       if (buffer == null)
-                               throw new ObjectDisposedException ("buffer");
-                       if (position < 0)
-                               throw new ArgumentOutOfRangeException ();
-                       
-                       return buffer.Read<char> ((ulong) position);
-               }
-               
-               public decimal ReadDecimal (long position) 
-               {
-                       if (!canread)
-                               throw new NotSupportedException ();
-                       if (buffer == null)
-                               throw new ObjectDisposedException ("buffer");
-                       if (position < 0)
-                               throw new ArgumentOutOfRangeException ();
-                       
-                       return buffer.Read<decimal> ((ulong) position);
-               }
-               
-               public double ReadDouble (long position) 
-               {
-                       if (!canread)
-                               throw new NotSupportedException ();
-                       if (buffer == null)
-                               throw new ObjectDisposedException ("buffer");
-                       if (position < 0)
-                               throw new ArgumentOutOfRangeException ();
-                       
-                       return buffer.Read<double> ((ulong) position);
-               }
-
-               public short ReadInt16 (long position) 
-               {
-                       if (!canread)
-                               throw new NotSupportedException ();
-                       if (buffer == null)
-                               throw new ObjectDisposedException ("buffer");
-                       if (position < 0)
-                               throw new ArgumentOutOfRangeException ();
-                       
-                       return buffer.Read<short> ((ulong) position);
-               }
-               
-               public int ReadInt32 (long position) 
-               {
-                       if (!canread)
-                               throw new NotSupportedException ();
-                       if (buffer == null)
-                               throw new ObjectDisposedException ("buffer");
-                       if (position < 0)
-                               throw new ArgumentOutOfRangeException ();
-                       
-                       return buffer.Read<int> ((ulong) position);
-               }
-               
-               public long ReadInt64 (long position) 
-               {
-                       if (!canread)
-                               throw new NotSupportedException ();
-                       if (buffer == null)
-                               throw new ObjectDisposedException ("buffer");
-                       if (position < 0)
-                               throw new ArgumentOutOfRangeException ();
-                       
-                       return buffer.Read<long> ((ulong) position);
-               }
-               
-               [CLSCompliant (false)]
-               public sbyte ReadSByte (long position) 
-               {
-                       if (!canread)
-                               throw new NotSupportedException ();
-                       if (buffer == null)
-                               throw new ObjectDisposedException ("buffer");
-                       if (position < 0)
-                               throw new ArgumentOutOfRangeException ();
-                       
-                       return buffer.Read<sbyte> ((ulong) position);
-               }
-               
-               public float ReadSingle (long position) 
-               {
-                       if (!canread)
-                               throw new NotSupportedException ();
-                       if (buffer == null)
-                               throw new ObjectDisposedException ("buffer");
-                       if (position < 0)
-                               throw new ArgumentOutOfRangeException ();
-                       
-                       return buffer.Read<float> ((ulong) position);
-               }
-               
-               [CLSCompliant (false)]
-               public ushort ReadUInt16 (long position) 
-               {
-                       if (!canread)
-                               throw new NotSupportedException ();
-                       if (buffer == null)
-                               throw new ObjectDisposedException ("buffer");
-                       if (position < 0)
-                               throw new ArgumentOutOfRangeException ();
-                       
-                       return buffer.Read<ushort> ((ulong) position);
-               }
-
-               [CLSCompliant (false)]
-               public uint ReadUInt32 (long position) 
-               {
-                       if (!canread)
-                               throw new NotSupportedException ();
-                       if (buffer == null)
-                               throw new ObjectDisposedException ("buffer");
-                       if (position < 0)
-                               throw new ArgumentOutOfRangeException ();
-                       
-                       return buffer.Read<uint> ((ulong) position);
-               }
-
-               [CLSCompliant (false)]
-               public ulong ReadUInt64 (long position) 
-               {
-                       if (!canread)
-                               throw new NotSupportedException ();
-                       if (buffer == null)
-                               throw new ObjectDisposedException ("buffer");
-                       if (position < 0)
-                               throw new ArgumentOutOfRangeException ();
-                       
-                       return buffer.Read<ulong> ((ulong) position);
-               }
-
-               public void Read<T> (long position, out T structure) where T : struct
-               {
-                       if (!canread)
-                               throw new NotSupportedException ();
-                       if (buffer == null)
-                               throw new ObjectDisposedException ("buffer");
-                       if (position < 0)
-                               throw new ArgumentOutOfRangeException ();
-                       
-                       structure = buffer.Read<T> ((ulong) position);
-               }
-
-               public int ReadArray<T> (long position, T [] array, int offset, int count) where T : struct
-               {
-                       if (position < 0)
-                               throw new ArgumentOutOfRangeException ();
-                       
-                       long left = capacity - position;
-                       var slots = Math.Min (count, (int)(left / Marshal.SizeOf (typeof (T))));
-
-                       buffer.ReadArray ((ulong) position, array, offset, slots);
-                       return slots;
-               }
-               
-               public void Write (long position, bool value) 
-               {
-                       if (!canwrite)
-                               throw new NotSupportedException ();
-                       if (buffer == null)
-                               throw new ObjectDisposedException ("buffer");
-                       if (position < 0)
-                               throw new ArgumentOutOfRangeException ();
-                       
-                       buffer.Write ((ulong)position, value);
-               }
-
-               public void Write (long position, byte value) 
-               {
-                       if (!canwrite)
-                               throw new NotSupportedException ();
-                       if (buffer == null)
-                               throw new ObjectDisposedException ("buffer");
-                       if (position < 0)
-                               throw new ArgumentOutOfRangeException ();
-                       
-                       buffer.Write ((ulong)position, value);
-               }
-
-               public void Write (long position, char value) 
-               {
-                       if (!canwrite)
-                               throw new NotSupportedException ();
-                       if (buffer == null)
-                               throw new ObjectDisposedException ("buffer");
-                       if (position < 0)
-                               throw new ArgumentOutOfRangeException ();
-                       
-                       buffer.Write ((ulong)position, value);
-               }
-
-               public void Write (long position, decimal value) 
-               {
-                       if (!canwrite)
-                               throw new NotSupportedException ();
-                       if (buffer == null)
-                               throw new ObjectDisposedException ("buffer");
-                       if (position < 0)
-                               throw new ArgumentOutOfRangeException ();
-                       
-                       buffer.Write ((ulong)position, value);
-               }
-               
-               public void Write (long position, double value) 
-               {
-                       if (!canwrite)
-                               throw new NotSupportedException ();
-                       if (buffer == null)
-                               throw new ObjectDisposedException ("buffer");
-                       if (position < 0)
-                               throw new ArgumentOutOfRangeException ();
-                       
-                       buffer.Write ((ulong)position, value);
-               }
-
-               public void Write (long position, short value) 
-               {
-                       if (!canwrite)
-                               throw new NotSupportedException ();
-                       if (buffer == null)
-                               throw new ObjectDisposedException ("buffer");
-                       if (position < 0)
-                               throw new ArgumentOutOfRangeException ();
-                       
-                       buffer.Write ((ulong)position, value);
-               }
-
-               public void Write (long position, int value) 
-               {
-                       if (!canwrite)
-                               throw new NotSupportedException ();
-                       if (buffer == null)
-                               throw new ObjectDisposedException ("buffer");
-                       if (position < 0)
-                               throw new ArgumentOutOfRangeException ();
-                       
-                       buffer.Write ((ulong)position, value);
-               }
-
-               public void Write (long position, long value) 
-               {
-                       if (!canwrite)
-                               throw new NotSupportedException ();
-                       if (buffer == null)
-                               throw new ObjectDisposedException ("buffer");
-                       if (position < 0)
-                               throw new ArgumentOutOfRangeException ();
-                       
-                       buffer.Write ((ulong)position, value);
-               }
-
-               [CLSCompliant (false)]
-               public void Write (long position, sbyte value) 
-               {
-                       if (!canwrite)
-                               throw new NotSupportedException ();
-                       if (buffer == null)
-                               throw new ObjectDisposedException ("buffer");
-                       if (position < 0)
-                               throw new ArgumentOutOfRangeException ();
-                       
-                       buffer.Write ((ulong)position, value);
-               }
-
-               public void Write (long position, float value) 
-               {
-                       if (!canwrite)
-                               throw new NotSupportedException ();
-                       if (buffer == null)
-                               throw new ObjectDisposedException ("buffer");
-                       if (position < 0)
-                               throw new ArgumentOutOfRangeException ();
-                       
-                       buffer.Write ((ulong)position, value);
-               }
-
-               [CLSCompliant (false)]
-               public void Write (long position, ushort value) 
-               {
-                       if (!canwrite)
-                               throw new NotSupportedException ();
-                       if (buffer == null)
-                               throw new ObjectDisposedException ("buffer");
-                       if (position < 0)
-                               throw new ArgumentOutOfRangeException ();
-                       
-                       buffer.Write ((ulong)position, value);
-               }
-
-               [CLSCompliant (false)]
-               public void Write (long position, uint value) 
-               {
-                       if (!canwrite)
-                               throw new NotSupportedException ();
-                       if (buffer == null)
-                               throw new ObjectDisposedException ("buffer");
-                       if (position < 0)
-                               throw new ArgumentOutOfRangeException ();
-                       
-                       buffer.Write ((ulong)position, value);
-               }
-
-               [CLSCompliant (false)]
-               public void Write (long position, ulong value) 
-               {
-                       if (!canwrite)
-                               throw new NotSupportedException ();
-                       if (buffer == null)
-                               throw new ObjectDisposedException ("buffer");
-                       if (position < 0)
-                               throw new ArgumentOutOfRangeException ();
-                       
-                       buffer.Write ((ulong)position, value);
-               }
-
-               public void Write<T> (long position, ref T structure) where T : struct
-               {
-                       if (!canwrite)
-                               throw new NotSupportedException ();
-                       if (buffer == null)
-                               throw new ObjectDisposedException ("buffer");
-                       if (position < 0)
-                               throw new ArgumentOutOfRangeException ();
-                       
-                       buffer.Write<T> ((ulong)position, structure);
-               }
-
-               public void WriteArray<T> (long position, T [] array, int offset, int count) where T : struct 
-               {
-                       buffer.WriteArray ((ulong)position, array, offset, count);
-               }
-       
-               public bool CanRead {
-                       get { return canread; }
-               }
-
-               public bool CanWrite {
-                       get { return canwrite; }
-               }
-
-               public long Capacity {
-                       get { return capacity; }
-               }
-               
-               protected bool IsOpen {
-                       get { return buffer != null; }
-               }
-       }
-}
-
index 96ded2372d338f791db6fd2e2c1f4571d4ca4422..34051bd8368e1e1cebe60a5e72d0aa6ad65a4a76 100644 (file)
@@ -139,14 +139,16 @@ namespace System.Reflection {
 
                internal static RuntimeAssembly LoadWithPartialNameInternal (String partialName, Evidence securityEvidence, ref StackCrawlMark stackMark)
                {
-                       AssemblyName an = new AssemblyName(partialName);
-                       return LoadWithPartialNameInternal (an, securityEvidence, ref stackMark);
+                       // Mono runtime does not support StackCrawlMark
+                       //FIXME stackMark should probably change method behavior in some cases.
+                       return (RuntimeAssembly) Assembly.LoadWithPartialName (partialName, securityEvidence);
                }
 
                internal static RuntimeAssembly LoadWithPartialNameInternal (AssemblyName an, Evidence securityEvidence, ref StackCrawlMark stackMark)
                {
-                       throw new NotImplementedException ("LoadWithPartialNameInternal");
+                       return LoadWithPartialNameInternal (an.ToString (), securityEvidence, ref stackMark);
                }
+
        }
 
        [ComVisible (true)]
index 491e2cbf33e1726fd2a7b8084908b6f89d40d320..f9a931f1135d39d71828ea7573124ee49683542e 100644 (file)
@@ -282,15 +282,6 @@ namespace System.Reflection {
                        ParameterInfo[] pinfo = GetParametersInternal ();
                        ConvertValues (binder, parameters, pinfo, culture, invokeAttr);
 
-#if !NET_2_1
-                       if (SecurityManager.SecurityEnabled) {
-                               // sadly Attributes doesn't tell us which kind of security action this is so
-                               // we must do it the hard way - and it also means that we can skip calling
-                               // Attribute (which is another an icall)
-                               SecurityManager.ReflectedLinkDemandInvoke (this);
-                       }
-#endif
-
                        if (ContainsGenericParameters)
                                throw new InvalidOperationException ("Late bound operations cannot be performed on types or methods for which ContainsGenericParameters is true.");
 
@@ -634,15 +625,6 @@ namespace System.Reflection {
 
                        MonoMethod.ConvertValues (binder, parameters, pinfo, culture, invokeAttr);
 
-#if !NET_2_1
-                       if (SecurityManager.SecurityEnabled) {
-                               // sadly Attributes doesn't tell us which kind of security action this is so
-                               // we must do it the hard way - and it also means that we can skip calling
-                               // Attribute (which is another an icall)
-                               SecurityManager.ReflectedLinkDemandInvoke (this);
-                       }
-#endif
-
                        if (obj == null && DeclaringType.ContainsGenericParameters)
                                throw new MemberAccessException ("Cannot create an instance of " + DeclaringType + " because Type.ContainsGenericParameters is true.");
 
index 44c9ec8a72670db2e0354972d4c05aad60f47d88..8bed0815d260a9d15a98da78b35cdbbe2a62f6ba 100644 (file)
@@ -979,6 +979,21 @@ namespace System.Runtime.InteropServices
                        return SizeOf (structure.GetType ());
                }
 
+               internal static uint SizeOfType (Type type)
+               {
+                       return (uint) SizeOf (type);
+               }
+
+               internal static uint AlignedSizeOf<T> () where T : struct
+               {
+                       uint size = SizeOfType (typeof (T));
+                       if (size == 1 || size == 2)
+                               return size;
+                       if (IntPtr.Size == 8 && size == 4)
+                               return size;
+                       return (size + 3) & (~((uint)3));
+               }
+
                [MethodImplAttribute(MethodImplOptions.InternalCall)]
                public extern static IntPtr StringToBSTR (string s);
 
index d6fb5d8d9dea5089c6aab58f49b23a4e0336bf21..15fbb4ad39029df6e511b002241ab9ebc47a0124 100644 (file)
@@ -58,50 +58,6 @@ namespace System.Security {
                        new PermissionSet (this).Assert ();
                }
 
-               internal bool CheckAssert (CodeAccessPermission asserted)
-               {
-                       if (asserted == null)
-                               return false;
-                       if (asserted.GetType () != this.GetType ())
-                               return false;
-                       return IsSubsetOf (asserted);
-               }
-
-               internal bool CheckDemand (CodeAccessPermission target)
-               {
-                       if (target == null)
-                               return false;
-                       if (target.GetType () != this.GetType ())
-                               return false;
-                       return IsSubsetOf (target);
-               }
-
-               internal bool CheckDeny (CodeAccessPermission denied)
-               {
-                       if (denied == null)
-                               return true;
-                       Type t = denied.GetType ();
-                       if (t != this.GetType ())
-                               return true;
-                       IPermission inter = Intersect (denied);
-                       if (inter == null)
-                               return true;
-                       // sadly that's not enough :( at this stage we must also check
-                       // if an empty (PermissionState.None) is a subset of the denied
-                       // (which is like a empty intersection looks like for flag based
-                       // permissions, e.g. AspNetHostingPermission).
-                       return denied.IsSubsetOf (PermissionBuilder.Create (t));
-               }
-
-               internal bool CheckPermitOnly (CodeAccessPermission target)
-               {
-                       if (target == null)
-                               return false;
-                       if (target.GetType () != this.GetType ())
-                               return false;
-                       return IsSubsetOf (target);
-               }
-
                public abstract IPermission Copy ();
 
                public void Demand ()
@@ -169,28 +125,7 @@ namespace System.Security {
                {
                        if (!SecurityManager.SecurityEnabled)
                                return;
-
-                       SecurityFrame sf = new SecurityFrame (1);
-                       bool revert = false;
-                       if ((sf.Assert != null) && !sf.Assert.DeclarativeSecurity) {
-                               revert = true;
-                               throw new NotSupportedException ("Currently only declarative Assert are supported.");
-                       }
-                       if ((sf.Deny != null) && !sf.Deny.DeclarativeSecurity) {
-                               revert = true;
-                               throw new NotSupportedException ("Currently only declarative Deny are supported.");
-                       }
-                       if ((sf.PermitOnly != null) && !sf.PermitOnly.DeclarativeSecurity) {
-                               revert = true;
-                               throw new NotSupportedException ("Currently only declarative PermitOnly are supported.");
-                       }
-
-                       if (!revert) {
-                               string msg = Locale.GetText ("No stack modifiers are present on the current stack frame.");
-                               // FIXME: we don't (yet) support imperative stack modifiers
-                               msg += Environment.NewLine + "Currently only declarative stack modifiers are supported.";
-                               throw new ExecutionEngineException (msg);
-                       }
+                       throw new NotImplementedException ();
                }
 
                [MonoTODO ("CAS support is experimental (and unsupported). Imperative mode is not implemented.")]
@@ -198,14 +133,7 @@ namespace System.Security {
                {
                        if (!SecurityManager.SecurityEnabled)
                                return;
-
-                       SecurityFrame sf = new SecurityFrame (1);
-                       if ((sf.Assert != null) && !sf.Assert.DeclarativeSecurity) {
-                               throw new NotSupportedException ("Currently only declarative Assert are supported.");
-                       } else {
-                               // we can't revert declarative security (or an empty frame) imperatively
-                               ThrowExecutionEngineException (SecurityAction.Assert);
-                       }
+                       throw new NotImplementedException ();
                }
 
                [MonoTODO ("CAS support is experimental (and unsupported). Imperative mode is not implemented.")]
@@ -213,14 +141,7 @@ namespace System.Security {
                {
                        if (!SecurityManager.SecurityEnabled)
                                return;
-
-                       SecurityFrame sf = new SecurityFrame (1);
-                       if ((sf.Deny != null) && !sf.Deny.DeclarativeSecurity) {
-                               throw new NotSupportedException ("Currently only declarative Deny are supported.");
-                       } else {
-                               // we can't revert declarative security (or an empty frame) imperatively
-                               ThrowExecutionEngineException (SecurityAction.Deny);
-                       }
+                       throw new NotImplementedException ();
                }
 
                [MonoTODO ("CAS support is experimental (and unsupported). Imperative mode is not implemented.")]
@@ -228,14 +149,7 @@ namespace System.Security {
                {
                        if (!SecurityManager.SecurityEnabled)
                                return;
-
-                       SecurityFrame sf = new SecurityFrame (1);
-                       if ((sf.PermitOnly != null) && sf.PermitOnly.DeclarativeSecurity) {
-                               throw new NotSupportedException ("Currently only declarative PermitOnly are supported.");
-                       } else {
-                               // we can't revert declarative security (or an empty frame) imperatively
-                               ThrowExecutionEngineException (SecurityAction.PermitOnly);
-                       }
+                       throw new NotImplementedException ();
                }
 
                // Internal helpers methods
@@ -313,80 +227,11 @@ namespace System.Security {
                        return (String.Compare (value, Boolean.TrueString, true, CultureInfo.InvariantCulture) == 0);
                }
 
-               internal bool ProcessFrame (SecurityFrame frame)
-               { 
-                       // 1. CheckPermitOnly
-                       if (frame.PermitOnly != null) {
-                               // the demanded permission must be in one of the permitted...
-                               bool permit = frame.PermitOnly.IsUnrestricted ();
-                               if (!permit) {
-                                       // check individual permissions
-                                       foreach (IPermission p in frame.PermitOnly) {
-                                               if (CheckPermitOnly (p as CodeAccessPermission)) {
-                                                       permit = true;
-                                                       break;
-                                               }
-                                       }
-                               }
-                               if (!permit) {
-                                       // ...or else we throw
-                                       ThrowSecurityException (this, "PermitOnly", frame, SecurityAction.Demand, null);
-                               }
-                       }
-
-                       // 2. CheckDeny
-                       if (frame.Deny != null) {
-                               // special case where everything is denied (i.e. no child to be processed)
-                               if (frame.Deny.IsUnrestricted ())
-                                       ThrowSecurityException (this, "Deny", frame, SecurityAction.Demand, null);
-                               foreach (IPermission p in frame.Deny) {
-                                       if (!CheckDeny (p as CodeAccessPermission))
-                                               ThrowSecurityException (this, "Deny", frame, SecurityAction.Demand, p);
-                               }
-                       }
-
-                       // 3. CheckAssert
-                       if (frame.Assert != null) {
-                               if (frame.Assert.IsUnrestricted ())
-                                       return true; // remove permission and continue stack walk
-                               foreach (IPermission p in frame.Assert) {
-                                       if (CheckAssert (p as CodeAccessPermission)) {
-                                               return true; // remove permission and continue stack walk
-                                       }
-                               }
-                       }
-
-                       // continue the stack walk
-                       return false; 
-               }
-
                internal static void ThrowInvalidPermission (IPermission target, Type expected) 
                {
                        string msg = Locale.GetText ("Invalid permission type '{0}', expected type '{1}'.");
                        msg = String.Format (msg, target.GetType (), expected);
                        throw new ArgumentException (msg, "target");
                }
-
-               internal static void ThrowExecutionEngineException (SecurityAction stackmod)
-               {
-                       string msg = Locale.GetText ("No {0} modifier is present on the current stack frame.");
-                       // FIXME: we don't (yet) support imperative stack modifiers
-                       msg += Environment.NewLine + "Currently only declarative stack modifiers are supported.";
-                       throw new ExecutionEngineException (String.Format (msg, stackmod));
-               }
-
-               internal static void ThrowSecurityException (object demanded, string message, SecurityFrame frame,
-                       SecurityAction action, IPermission failed)
-               {
-#if NET_2_1
-                       throw new SecurityException (message);
-#else
-                       Assembly a = frame.Assembly;
-                       throw new SecurityException (Locale.GetText (message), 
-                               a.UnprotectedGetName (), a.GrantedPermissionSet, 
-                               a.DeniedPermissionSet, frame.Method, action, demanded, 
-                               failed, a.UnprotectedGetEvidence ());
-#endif
-               }
        }
 }
index d5dcb8d8858efe2bf92b196d39d00cc9e674f644..54cc0c1b3607e186cd7fa80511c13b32f6fb082f 100644 (file)
@@ -234,35 +234,6 @@ namespace System.Security {
                                // special case when directly called from CodeAccessPermission.Demand
                                _ignored = new bool [list.Count];
                        }
-
-                       ArrayList frames = SecurityFrame.GetStack (skip);
-                       if ((frames != null) && (frames.Count > 0)) {
-                               SecurityFrame first = ((SecurityFrame) frames [0]);
-                               current = first.Assembly;
-                               domain = first.Domain;
-                               // skip ourself, Demand and other security runtime methods
-                               foreach (SecurityFrame sf in frames) {
-                                       if (ProcessFrame (sf, ref current, ref domain)) {
-                                               if (AllIgnored ())
-                                                       return; // reached Assert
-                                       }
-                               }
-                               SecurityFrame last = ((SecurityFrame) frames [frames.Count - 1]);
-                               CheckAssembly (current, last);
-                               CheckAppDomain (domain, last);
-                       }
-#if FEATURE_COMPRESSEDSTACK
-                       // Is there a CompressedStack to handle ?
-                       CompressedStack stack = Thread.CurrentThread.GetCompressedStack ();
-                       if ((stack != null) && !stack.IsEmpty ()) {
-                               foreach (SecurityFrame frame in stack.List) {
-                                       if (ProcessFrame (frame, ref current, ref domain)) {
-                                               if (AllIgnored ())
-                                                       return; // reached Assert
-                                       }
-                               }
-                       }
-#endif
                }
 
                [MonoTODO ("CAS support is experimental (and unsupported). Imperative mode is not implemented.")]
@@ -682,65 +653,6 @@ namespace System.Security {
                        return true;
                }
 
-               internal bool ProcessFrame (SecurityFrame frame, ref Assembly current, ref AppDomain domain)
-               {
-                       if (IsUnrestricted ()) {
-                               // we request unrestricted
-                               if (frame.Deny != null) {
-                                       // but have restrictions (some denied permissions)
-                                       CodeAccessPermission.ThrowSecurityException (this, "Deny", frame, SecurityAction.Demand, null);
-                               } else if ((frame.PermitOnly != null) && !frame.PermitOnly.IsUnrestricted ()) {
-                                       // but have restrictions (only some permitted permissions)
-                                       CodeAccessPermission.ThrowSecurityException (this, "PermitOnly", frame, SecurityAction.Demand, null);
-                               }
-                       }
-
-                       // skip next steps if no Assert, Deny or PermitOnly are present
-                       if (frame.HasStackModifiers) {
-                               for (int i = 0; i < list.Count; i++) {
-                                       CodeAccessPermission cap = (CodeAccessPermission) list [i];
-                                       if (cap.ProcessFrame (frame)) {
-                                               _ignored [i] = true; // asserted
-                                               if (AllIgnored ())
-                                                       return true; // no more, abort stack walk!
-                                       }
-                               }
-                       }
-
-                       // however the "final" grant set is resolved by assembly, so
-                       // there's no need to check it every time (just when we're 
-                       // changing assemblies between frames).
-                       if (frame.Assembly != current) {
-                               CheckAssembly (current, frame);
-                               current = frame.Assembly;
-                       }
-
-                       if (frame.Domain != domain) {
-                               CheckAppDomain (domain, frame);
-                               domain = frame.Domain;
-                       }
-
-                       return false;
-               }
-
-               internal void CheckAssembly (Assembly a, SecurityFrame frame)
-               {
-                       IPermission p = SecurityManager.CheckPermissionSet (a, this, false);
-                       if (p != null) {
-                               CodeAccessPermission.ThrowSecurityException (this, "Demand failed assembly permissions checks.",
-                                       frame, SecurityAction.Demand, p);
-                       }
-               }
-
-               internal void CheckAppDomain (AppDomain domain, SecurityFrame frame)
-               {
-                       IPermission p = SecurityManager.CheckPermissionSet (domain, this);
-                       if (p != null) {
-                               CodeAccessPermission.ThrowSecurityException (this, "Demand failed appdomain permissions checks.",
-                                       frame, SecurityAction.Demand, p);
-                       }
-               }
-
                // 2.0 metadata format
 
                internal static PermissionSet CreateFromBinaryFormat (byte[] data)
index e7535bd89cd05a9ba450ea1ddca19ffdfde284aa..d2fedeb286bef7d1ac26e33f221f68ce88ff8ad0 100644 (file)
@@ -41,91 +41,4 @@ namespace System.Security {
                public int size;
                public int index;
        }
-
-       internal struct SecurityFrame {
-
-               private AppDomain _domain;
-               private MethodInfo _method;
-               private PermissionSet _assert;
-               private PermissionSet _deny;
-               private PermissionSet _permitonly;
-
-               internal SecurityFrame (int skip)
-               {
-                       _domain = null;
-                       _method = null;
-                       _assert = null;
-                       _deny = null;
-                       _permitonly = null;
-
-                       throw new NotImplementedException ();
-               }
-
-               public Assembly Assembly {
-                       get { return _method.ReflectedType.Assembly; }
-               }
-
-               public AppDomain Domain {
-                       get { return _domain; }
-               }
-
-               public MethodInfo Method {
-                       get { return _method; }
-               }
-
-               public PermissionSet Assert {
-                       get { return _assert; }
-               }
-
-               public PermissionSet Deny {
-                       get { return _deny; }
-               }
-
-               public PermissionSet PermitOnly {
-                       get { return _permitonly; }
-               }
-
-               public bool HasStackModifiers {
-                       get { return ((_assert != null) || (_deny != null) || (_permitonly != null)); }
-               }
-
-               public bool Equals (SecurityFrame sf)
-               {
-                       if (!Object.ReferenceEquals (_domain, sf.Domain))
-                               return false;
-                       if (Assembly.ToString () != sf.Assembly.ToString ())
-                               return false;
-                       if (Method.ToString () != sf.Method.ToString ())
-                               return false;
-
-                       if ((_assert != null) && !_assert.Equals (sf.Assert))
-                               return false;
-                       if ((_deny != null) && !_deny.Equals (sf.Deny))
-                               return false;
-                       if ((_permitonly != null) && !_permitonly.Equals (sf.PermitOnly))
-                               return false;
-
-                       return true;
-               }
-
-               public override string ToString ()
-               {
-                       StringBuilder sb = new StringBuilder ();
-                       sb.AppendFormat ("Frame: {0}{1}", _method, Environment.NewLine);
-                       sb.AppendFormat ("\tAppDomain: {0}{1}", Domain, Environment.NewLine);
-                       sb.AppendFormat ("\tAssembly: {0}{1}", Assembly, Environment.NewLine);
-                       if (_assert != null)
-                               sb.AppendFormat ("\tAssert: {0}{1}", _assert, Environment.NewLine);
-                       if (_deny != null)
-                               sb.AppendFormat ("\tDeny: {0}{1}", _deny, Environment.NewLine);
-                       if (_permitonly != null)
-                               sb.AppendFormat ("\tPermitOnly: {0}{1}", _permitonly, Environment.NewLine);
-                       return sb.ToString ();
-               }
-
-               static public ArrayList GetStack (int skipFrames)
-               {
-                       return new ArrayList ();
-               }
-       }
 }
index d8a3e72dafb9de280de4972010ea09a2b4b11544..376e69998c984c4b1a6e297a1c70596066fd9d9c 100644 (file)
@@ -71,13 +71,12 @@ namespace System.Security {
                // properties
 
                [Obsolete]
-               extern public static bool CheckExecutionRights {
-                       [MethodImplAttribute (MethodImplOptions.InternalCall)]
-                       get;
-
-                       [MethodImplAttribute (MethodImplOptions.InternalCall)]
-                       [SecurityPermission (SecurityAction.Demand, ControlPolicy = true)]
-                       set;
+               public static bool CheckExecutionRights {
+                       get {
+                               return false;
+                       }
+                       set {
+                       }
                }
 
                [Obsolete ("The security manager cannot be turned off on MS runtime")]
@@ -154,68 +153,6 @@ namespace System.Security {
                        return true;
                }
 
-               internal static IPermission CheckPermissionSet (Assembly a, PermissionSet ps, bool noncas)
-               {
-                       if (ps.IsEmpty ())
-                               return null;
-
-                       foreach (IPermission p in ps) {
-                               // note: this may contains non CAS permissions
-                               if ((!noncas) && (p is CodeAccessPermission)) {
-                                       if (!IsGranted (a, p))
-                                               return p;
-                               } else {
-                                       // but non-CAS will throw on failure...
-                                       try {
-                                               p.Demand ();
-                                       }
-                                       catch (SecurityException) {
-                                               // ... so we catch
-                                               return p;
-                                       }
-                               }
-                       }
-                       return null;
-               }
-
-               internal static IPermission CheckPermissionSet (AppDomain ad, PermissionSet ps)
-               {
-                       if ((ps == null) || ps.IsEmpty ())
-                               return null;
-
-                       PermissionSet granted = ad.GrantedPermissionSet;
-                       if (granted == null)
-                               return null;
-                       if (granted.IsUnrestricted ())
-                               return null;
-                       if (ps.IsUnrestricted ())
-                               return new SecurityPermission (SecurityPermissionFlag.NoFlags);
-
-                       foreach (IPermission p in ps) {
-                               if (p is CodeAccessPermission) {
-                                       CodeAccessPermission grant = (CodeAccessPermission) granted.GetPermission (p.GetType ());
-                                       if (grant == null) {
-                                               if (!granted.IsUnrestricted () || !(p is IUnrestrictedPermission)) {
-                                                       if (!p.IsSubsetOf (null))
-                                                               return p;
-                                               }
-                                       } else if (!p.IsSubsetOf (grant)) {
-                                               return p;
-                                       }
-                               } else {
-                                       // but non-CAS will throw on failure...
-                                       try {
-                                               p.Demand ();
-                                       }
-                                       catch (SecurityException) {
-                                               // ... so we catch
-                                               return p;
-                                       }
-                               }
-                       }
-                       return null;
-               }
-
                [Obsolete]
                [SecurityPermission (SecurityAction.Demand, ControlPolicy = true)]
                public static PolicyLevel LoadPolicyLevelFromFile (string path, PolicyLevelType type)
@@ -529,179 +466,6 @@ namespace System.Security {
                        }
                }
 
-               //  security check when using reflection
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)]
-               private static unsafe extern bool GetLinkDemandSecurity (MethodBase method, RuntimeDeclSecurityActions *cdecl, RuntimeDeclSecurityActions *mdecl);
-
-               // When using reflection LinkDemand are promoted to full Demand (i.e. stack walk)
-               internal unsafe static void ReflectedLinkDemandInvoke (MethodBase mb)
-               {
-                       RuntimeDeclSecurityActions klass;
-                       RuntimeDeclSecurityActions method;
-
-                       if (!GetLinkDemandSecurity (mb, &klass, &method))
-                               return;
-
-                       PermissionSet ps = null;
-
-                       if (klass.cas.size > 0) {
-                               ps = Decode (klass.cas.blob, klass.cas.size);
-                       }
-                       if (klass.noncas.size > 0) {
-                               PermissionSet p = Decode (klass.noncas.blob, klass.noncas.size);
-                               ps = (ps == null) ? p : ps.Union (p);
-                       }
-
-                       if (method.cas.size > 0) {
-                               PermissionSet p = Decode (method.cas.blob, method.cas.size);
-                               ps = (ps == null) ? p : ps.Union (p);
-                       }
-                       if (method.noncas.size > 0) {
-                               PermissionSet p = Decode (method.noncas.blob, method.noncas.size);
-                               ps = (ps == null) ? p : ps.Union (p);
-                       }
-
-                       // in this case we union-ed the permission sets because we want to do 
-                       // a single stack walk (not up to 4).
-                       if (ps != null)
-                               ps.Demand ();
-               }
-
-               internal unsafe static bool ReflectedLinkDemandQuery (MethodBase mb)
-               {
-                       RuntimeDeclSecurityActions klass;
-                       RuntimeDeclSecurityActions method;
-
-                       if (!GetLinkDemandSecurity (mb, &klass, &method))
-                               return true;
-
-                       return LinkDemand (mb.ReflectedType.Assembly, &klass, &method);
-               }
-
-               private unsafe static bool LinkDemand (Assembly a, RuntimeDeclSecurityActions *klass, RuntimeDeclSecurityActions *method)
-               {
-                       try {
-                               PermissionSet ps = null;
-                               bool result = true;
-                               if (klass->cas.size > 0) {
-                                       ps = Decode (klass->cas.blob, klass->cas.size);
-                                       result = (SecurityManager.CheckPermissionSet (a, ps, false) == null);
-                               }
-                               if (result && (klass->noncas.size > 0)) {
-                                       ps = Decode (klass->noncas.blob, klass->noncas.size);
-                                       result = (SecurityManager.CheckPermissionSet (a, ps, true) == null);
-                               }
-
-                               if (result && (method->cas.size > 0)) {
-                                       ps = Decode (method->cas.blob, method->cas.size);
-                                       result = (SecurityManager.CheckPermissionSet (a, ps, false) == null);
-                               }
-                               if (result && (method->noncas.size > 0)) {
-                                       ps = Decode (method->noncas.blob, method->noncas.size);
-                                       result = (SecurityManager.CheckPermissionSet (a, ps, true) == null);
-                               }
-                               return result;
-                       }
-                       catch (SecurityException) {
-                               return false;
-                       }
-               }
-
-#pragma warning disable 169
-               private static bool LinkDemandFullTrust (Assembly a)
-               {
-                       // FullTrust is immutable (and means Unrestricted) 
-                       // so we can skip the subset operations and jump to IsUnrestricted.
-                       PermissionSet granted = a.GrantedPermissionSet;
-                       if ((granted != null) && !granted.IsUnrestricted ())
-                               return false;
-
-                       PermissionSet denied = a.DeniedPermissionSet;
-                       if ((denied != null) && !denied.IsEmpty ())
-                               return false;
-
-                       return true;
-               }
-
-               private static bool LinkDemandUnmanaged (Assembly a)
-               {
-                       // note: we know that UnmanagedCode (SecurityPermission) implements IUnrestrictedPermission
-                       return IsGranted (a, UnmanagedCode);
-               }
-
-               // we try to provide as much details as possible to help debugging
-               private static void LinkDemandSecurityException (int securityViolation, IntPtr methodHandle)
-               {
-                       RuntimeMethodHandle runtimeHandle = new RuntimeMethodHandle (methodHandle);
-                       MethodInfo method = (MethodInfo)(MethodBase.GetMethodFromHandle (runtimeHandle));
-                       Assembly a = method.DeclaringType.Assembly;
-
-                       string message = null;
-                       AssemblyName an = null;
-                       PermissionSet granted = null;
-                       PermissionSet refused = null;
-                       object demanded = null;
-                       IPermission failed = null;
-
-                       if (a != null) {
-                               an = a.UnprotectedGetName ();
-                               granted = a.GrantedPermissionSet;
-                               refused = a.DeniedPermissionSet;
-                       }
-
-                       switch (securityViolation) {
-                       case 1: // MONO_JIT_LINKDEMAND_PERMISSION
-                               message = Locale.GetText ("Permissions refused to call this method.");
-                               break;
-                       case 2: // MONO_JIT_LINKDEMAND_APTC
-                               message = Locale.GetText ("Partially trusted callers aren't allowed to call into this assembly.");
-                               demanded = (object) DefaultPolicies.FullTrust; // immutable
-                               break;
-                       case 4: // MONO_JIT_LINKDEMAND_ECMA
-                               message = Locale.GetText ("Calling internal calls is restricted to ECMA signed assemblies.");
-                               break;
-                       case 8: // MONO_JIT_LINKDEMAND_PINVOKE
-                               message = Locale.GetText ("Calling unmanaged code isn't allowed from this assembly.");
-                               demanded = (object) _unmanagedCode;
-                               failed = _unmanagedCode;
-                               break;
-                       default:
-                               message = Locale.GetText ("JIT time LinkDemand failed.");
-                               break;
-                       }
-
-                       throw new SecurityException (message, an, granted, refused, method, SecurityAction.LinkDemand, demanded, failed, null);
-               }
-
-               private static void InheritanceDemandSecurityException (int securityViolation, Assembly a, Type t, MethodInfo method)
-               {
-                       string message = null;
-                       AssemblyName an = null;
-                       PermissionSet granted = null;
-                       PermissionSet refused = null;
-
-                       if (a != null) {
-                               an = a.UnprotectedGetName ();
-                               granted = a.GrantedPermissionSet;
-                               refused = a.DeniedPermissionSet;
-                       }
-
-                       switch (securityViolation) {
-                       case 1: // MONO_METADATA_INHERITANCEDEMAND_CLASS
-                               message = String.Format (Locale.GetText ("Class inheritance refused for {0}."), t);
-                               break;
-                       case 2: // MONO_METADATA_INHERITANCEDEMAND_CLASS
-                               message = Locale.GetText ("Method override refused.");
-                               break;
-                       default:
-                               message = Locale.GetText ("Load time InheritDemand failed.");
-                               break;
-                       }
-
-                       throw new SecurityException (message, an, granted, refused, method, SecurityAction.InheritanceDemand, null, null, null);
-               }
-
                // called by the runtime when CoreCLR is enabled
 
                private static void ThrowException (Exception ex)
@@ -709,58 +473,6 @@ namespace System.Security {
                        throw ex;
                }
 
-               // internal - get called by the class loader
-
-               // Called when
-               // - class inheritance
-               // - method overrides
-               private unsafe static bool InheritanceDemand (AppDomain ad, Assembly a, RuntimeDeclSecurityActions *actions)
-               {
-                       try {
-                               PermissionSet ps = null;
-                               bool result = true;
-                               if (actions->cas.size > 0) {
-                                       ps = Decode (actions->cas.blob, actions->cas.size);
-                                       result = (SecurityManager.CheckPermissionSet (a, ps, false) == null);
-                                       if (result) {
-                                               // also check appdomain
-                                               result = (SecurityManager.CheckPermissionSet (ad, ps) == null);
-                                       }
-                               }
-                               if (actions->noncas.size > 0) {
-                                       ps = Decode (actions->noncas.blob, actions->noncas.size);
-                                       result = (SecurityManager.CheckPermissionSet (a, ps, true) == null);
-                                       if (result) {
-                                               // also check appdomain
-                                               result = (SecurityManager.CheckPermissionSet (ad, ps) == null);
-                                       }
-                               }
-                               return result;
-                       }
-                       catch (SecurityException) {
-                               return false;
-                       }
-               }
-
-               // internal - get called at JIT time
-
-               private static void DemandUnmanaged ()
-               {
-                       UnmanagedCode.Demand ();
-               }
-
-               // internal - get called by JIT generated code
-
-               private static void InternalDemand (IntPtr permissions, int length)
-               {
-                       PermissionSet ps = Decode (permissions, length);
-                       ps.Demand ();
-               }
-
-               private static void InternalDemandChoice (IntPtr permissions, int length)
-               {
-                       throw new SecurityException ("SecurityAction.DemandChoice was removed from 2.0");
-               }
 #pragma warning restore 169
 
                public static PermissionSet GetStandardSandbox (Evidence evidence)
index a9f6b3f20437cc382bb89b04842324d6df3461aa..07e78fdb27eb426dc600d9c6c4d84b0158092ab5 100644 (file)
@@ -197,16 +197,6 @@ namespace System.Security {
                        throw new NotSupportedException ();
                }
 
-               internal static void ReflectedLinkDemandInvoke (MethodBase mb)
-               {
-                       throw new NotSupportedException ();
-               }
-
-               internal static bool ReflectedLinkDemandQuery (MethodBase mb)
-               {
-                       throw new NotSupportedException ();
-               }
-
                public static PermissionSet GetStandardSandbox (Evidence evidence)
                {
                        if (evidence == null)
index 8e797d8cdc5eb74dc970940a6cc5ff1aabafc196..c30ceff5b92d1f16becd68bed83a26d3befeab99 100644 (file)
@@ -71,7 +71,7 @@ internal static partial class EncodingHelper
        [MethodImpl (MethodImplOptions.InternalCall)]
        extern internal static string InternalCodePage (ref int code_page);
 
-#if !(MONOTOUCH || XAMMAC)
+#if !MONOTOUCH
        internal static Encoding GetDefaultEncoding ()
        {
                Encoding enc = null;
index df3ac7d3b1afe68ccc178585c2020213cbcef657..454cb7c4a2c7a0cc6575ba9c6ac9f67fd1fece47 100644 (file)
@@ -65,7 +65,7 @@ namespace System.Threading {
                        throw new NotSupportedException ();
 #else
                        CompressedStack cs = new CompressedStack (0);
-                       cs._list = SecurityFrame.GetStack (1);
+                       cs._list = new ArrayList ();
 
                        // include any current CompressedStack inside the new Capture
                        CompressedStack currentCs = Thread.CurrentThread.ExecutionContext.SecurityContext.CompressedStack;
@@ -146,12 +146,6 @@ namespace System.Threading {
                        if (_list.Count != cs._list.Count)
                                return false;
 
-                       for (int i=0; i < _list.Count; i++) {
-                               SecurityFrame sf1 = (SecurityFrame) _list [i];
-                               SecurityFrame sf2 = (SecurityFrame) cs._list [i];
-                               if (!sf1.Equals (sf2))
-                                       return false;
-                       }
                        return true;
                }
 
index b0212729428fe3e2280b7586e45bf4db8f3e76cb..717bfa77c76f088a90578bb57be795b567fda494 100644 (file)
@@ -89,9 +89,10 @@ namespace System
                */
                private List<KeyValuePair<DateTime, TimeType>> transitions;
 
-#if !MOBILE
+#if !MOBILE || MOBILE_STATIC
                static TimeZoneInfo CreateLocal ()
                {
+#if !MOBILE_STATIC
                        if (IsWindows && LocalZoneKey != null) {
                                string name = (string)LocalZoneKey.GetValue ("TimeZoneKeyName");
                                if (name == null)
@@ -100,6 +101,7 @@ namespace System
                                if (name != null)
                                        return TimeZoneInfo.FindSystemTimeZoneById (name);
                        }
+#endif
 
                        var tz = Environment.GetEnvironmentVariable ("TZ");
                        if (tz != null) {
@@ -135,6 +137,7 @@ namespace System
 
                static void GetSystemTimeZones (List<TimeZoneInfo> systemTimeZones)
                {
+#if !MOBILE_STATIC
                        if (TimeZoneKey != null) {
                                foreach (string id in TimeZoneKey.GetSubKeyNames ()) {
                                        try {
@@ -144,6 +147,7 @@ namespace System
 
                                return;
                        }
+#endif
 
 #if LIBC
                        string[] continents = new string [] {"Africa", "America", "Antarctica", "Arctic", "Asia", "Atlantic", "Brazil", "Canada", "Chile", "Europe", "Indian", "Mexico", "Mideast", "Pacific", "US"};
@@ -202,7 +206,7 @@ namespace System
 #endif
                private AdjustmentRule [] adjustmentRules;
 
-#if !NET_2_1
+#if !NET_2_1 || MOBILE_STATIC
                /// <summary>
                /// Determine whether windows of not (taken Stephane Delcroix's code)
                /// </summary>
@@ -229,6 +233,7 @@ namespace System
                        return str.Substring (Istart, Iend-Istart+1);
                }
                
+#if !MOBILE_STATIC
                static RegistryKey timeZoneKey;
                static RegistryKey TimeZoneKey {
                        get {
@@ -256,6 +261,7 @@ namespace System
                                        "SYSTEM\\CurrentControlSet\\Control\\TimeZoneInformation", false);
                        }
                }
+#endif
 #endif
 
                private static bool TryAddTicks (DateTime date, long ticks, out DateTime result, DateTimeKind kind = DateTimeKind.Unspecified)
index b7227d972c3c0f20fa68c9f187f3403720fa144a..6e957ec7b7d255a992bb063c99556fe116e1584e 100644 (file)
@@ -195,11 +195,7 @@ namespace MonoTests.System.Reflection
 
                        Assert.IsTrue (corlib_test.GetReferencedAssemblies ().Length > 0, "GetReferencedAssemblies");
                        Assert.AreEqual (0, corlib_test.HostContext, "HostContext");
-#if NET_4_0 && !MOBILE
                        Assert.AreEqual ("v4.0.30319", corlib_test.ImageRuntimeVersion, "ImageRuntimeVersion");
-#else
-                       Assert.AreEqual ("v2.0.50727", corlib_test.ImageRuntimeVersion, "ImageRuntimeVersion");
-#endif
 
                        Assert.IsNotNull (corlib_test.ManifestModule, "ManifestModule");
                        Assert.IsFalse (corlib_test.ReflectionOnly, "ReflectionOnly");
index 3e183e7c4a9b7c27b3ce53f08672a1e7b378ca91..1b02a58884552a064a351aa33d386fc1fc65b195 100644 (file)
@@ -214,7 +214,6 @@ System.IO/SearchPattern.cs
 System.IO/SeekOrigin.cs
 System.IO/UnexceptionalStreamReader.cs
 System.IO/UnexceptionalStreamWriter.cs
-System.IO/UnmanagedMemoryAccessor.cs
 System.IO.IsolatedStorage/INormalizeForIsolatedStorage.cs
 System.IO.IsolatedStorage/IsolatedStorage.cs
 System.IO.IsolatedStorage/IsolatedStorageException.cs
@@ -997,6 +996,7 @@ ReferenceSources/SecurityContext.cs
 ../../../external/referencesource/mscorlib/system/int64.cs
 ../../../external/referencesource/mscorlib/system/iobservable.cs
 ../../../external/referencesource/mscorlib/system/iobserver.cs
+../../../external/referencesource/mscorlib/system/io/unmanagedmemoryaccessor.cs
 ../../../external/referencesource/mscorlib/system/iprogress.cs
 ../../../external/referencesource/mscorlib/system/iserviceobjectprovider.cs
 ../../../external/referencesource/mscorlib/system/invalidtimezoneexception.cs
index a089b81222dbe6bee0fc3f37fafe6c16f0ef4b0f..3c9ec62326ebec9c3bac530b44415aacaa4a0e2c 100644 (file)
@@ -275,6 +275,12 @@ namespace System.Linq.Expressions.Compiler {
                     if (rightType != typeof(int)) {
                         throw ContractUtils.Unreachable;
                     }
+                    // Note: If this code is made to handle unsigned
+                    // rightType types, emit the following when rightType:
+                    // is unsigned
+                    //_ilg.EmitInt(0x3f);
+                    _ilg.EmitInt(0x1f);
+                    _ilg.Emit(OpCodes.And);
                     _ilg.Emit(OpCodes.Shl);
                     break;
                 case ExpressionType.RightShift:
index 1dee0470816b6e9667888db2c1382d4935c1d6d4..a4e89d0ed579665bebd6161dd9980f31cc5de9d6 100644 (file)
@@ -46,428 +46,428 @@ Monodoc.Ecma/EcmaUrlTokenizer.cs
 Monodoc.Ecma/EcmaDesc.cs
 Mono.Documentation/ManifestResourceResolver.cs
 Mono.Documentation/XmlDocUtils.cs
-../../../external/Lucene.Net/src/core/Analysis/Analyzer.cs
-../../../external/Lucene.Net/src/core/Analysis/ASCIIFoldingFilter.cs
-../../../external/Lucene.Net/src/core/Analysis/BaseCharFilter.cs
-../../../external/Lucene.Net/src/core/Analysis/CachingTokenFilter.cs
-../../../external/Lucene.Net/src/core/Analysis/CharArraySet.cs
-../../../external/Lucene.Net/src/core/Analysis/CharFilter.cs
-../../../external/Lucene.Net/src/core/Analysis/CharReader.cs
-../../../external/Lucene.Net/src/core/Analysis/CharStream.cs
-../../../external/Lucene.Net/src/core/Analysis/CharTokenizer.cs
-../../../external/Lucene.Net/src/core/Analysis/ISOLatin1AccentFilter.cs
-../../../external/Lucene.Net/src/core/Analysis/KeywordAnalyzer.cs
-../../../external/Lucene.Net/src/core/Analysis/KeywordTokenizer.cs
-../../../external/Lucene.Net/src/core/Analysis/LengthFilter.cs
-../../../external/Lucene.Net/src/core/Analysis/LetterTokenizer.cs
-../../../external/Lucene.Net/src/core/Analysis/LowerCaseFilter.cs
-../../../external/Lucene.Net/src/core/Analysis/LowerCaseTokenizer.cs
-../../../external/Lucene.Net/src/core/Analysis/MappingCharFilter.cs
-../../../external/Lucene.Net/src/core/Analysis/NormalizeCharMap.cs
-../../../external/Lucene.Net/src/core/Analysis/NumericTokenStream.cs
-../../../external/Lucene.Net/src/core/Analysis/PerFieldAnalyzerWrapper.cs
-../../../external/Lucene.Net/src/core/Analysis/PorterStemFilter.cs
-../../../external/Lucene.Net/src/core/Analysis/PorterStemmer.cs
-../../../external/Lucene.Net/src/core/Analysis/SimpleAnalyzer.cs
-../../../external/Lucene.Net/src/core/Analysis/Standard/StandardAnalyzer.cs
-../../../external/Lucene.Net/src/core/Analysis/Standard/StandardFilter.cs
-../../../external/Lucene.Net/src/core/Analysis/Standard/StandardTokenizer.cs
-../../../external/Lucene.Net/src/core/Analysis/Standard/StandardTokenizerImpl.cs
-../../../external/Lucene.Net/src/core/Analysis/StopAnalyzer.cs
-../../../external/Lucene.Net/src/core/Analysis/StopFilter.cs
-../../../external/Lucene.Net/src/core/Analysis/TeeSinkTokenFilter.cs
-../../../external/Lucene.Net/src/core/Analysis/Token.cs
-../../../external/Lucene.Net/src/core/Analysis/Tokenattributes/FlagsAttribute.cs
-../../../external/Lucene.Net/src/core/Analysis/Tokenattributes/IFlagsAttribute.cs
-../../../external/Lucene.Net/src/core/Analysis/Tokenattributes/IOffsetAttribute.cs
-../../../external/Lucene.Net/src/core/Analysis/Tokenattributes/IPayloadAttribute.cs
-../../../external/Lucene.Net/src/core/Analysis/Tokenattributes/IPositionIncrementAttribute.cs
-../../../external/Lucene.Net/src/core/Analysis/Tokenattributes/ITermAttribute.cs
-../../../external/Lucene.Net/src/core/Analysis/Tokenattributes/ITypeAttribute.cs
-../../../external/Lucene.Net/src/core/Analysis/Tokenattributes/OffsetAttribute.cs
-../../../external/Lucene.Net/src/core/Analysis/Tokenattributes/PayloadAttribute.cs
-../../../external/Lucene.Net/src/core/Analysis/Tokenattributes/PositionIncrementAttribute.cs
-../../../external/Lucene.Net/src/core/Analysis/Tokenattributes/TermAttribute.cs
-../../../external/Lucene.Net/src/core/Analysis/Tokenattributes/TypeAttribute.cs
-../../../external/Lucene.Net/src/core/Analysis/TokenFilter.cs
-../../../external/Lucene.Net/src/core/Analysis/Tokenizer.cs
-../../../external/Lucene.Net/src/core/Analysis/TokenStream.cs
-../../../external/Lucene.Net/src/core/Analysis/WhitespaceAnalyzer.cs
-../../../external/Lucene.Net/src/core/Analysis/WhitespaceTokenizer.cs
-../../../external/Lucene.Net/src/core/Analysis/WordlistLoader.cs
-../../../external/Lucene.Net/src/core/Document/AbstractField.cs
-../../../external/Lucene.Net/src/core/Document/CompressionTools.cs
-../../../external/Lucene.Net/src/core/Document/DateField.cs
-../../../external/Lucene.Net/src/core/Document/DateTools.cs
-../../../external/Lucene.Net/src/core/Document/Document.cs
-../../../external/Lucene.Net/src/core/Document/Field.cs
-../../../external/Lucene.Net/src/core/Document/Fieldable.cs
-../../../external/Lucene.Net/src/core/Document/FieldSelector.cs
-../../../external/Lucene.Net/src/core/Document/FieldSelectorResult.cs
-../../../external/Lucene.Net/src/core/Document/LoadFirstFieldSelector.cs
-../../../external/Lucene.Net/src/core/Document/MapFieldSelector.cs
-../../../external/Lucene.Net/src/core/Document/NumberTools.cs
-../../../external/Lucene.Net/src/core/Document/NumericField.cs
-../../../external/Lucene.Net/src/core/Document/SetBasedFieldSelector.cs
-../../../external/Lucene.Net/src/core/Index/AbstractAllTermDocs.cs
-../../../external/Lucene.Net/src/core/Index/AllTermDocs.cs
-../../../external/Lucene.Net/src/core/Index/BufferedDeletes.cs
-../../../external/Lucene.Net/src/core/Index/ByteBlockPool.cs
-../../../external/Lucene.Net/src/core/Index/ByteSliceReader.cs
-../../../external/Lucene.Net/src/core/Index/ByteSliceWriter.cs
-../../../external/Lucene.Net/src/core/Index/CharBlockPool.cs
-../../../external/Lucene.Net/src/core/Index/CheckIndex.cs
-../../../external/Lucene.Net/src/core/Index/CompoundFileReader.cs
-../../../external/Lucene.Net/src/core/Index/CompoundFileWriter.cs
-../../../external/Lucene.Net/src/core/Index/ConcurrentMergeScheduler.cs
-../../../external/Lucene.Net/src/core/Index/CorruptIndexException.cs
-../../../external/Lucene.Net/src/core/Index/DefaultSkipListReader.cs
-../../../external/Lucene.Net/src/core/Index/DefaultSkipListWriter.cs
-../../../external/Lucene.Net/src/core/Index/DirectoryReader.cs
-../../../external/Lucene.Net/src/core/Index/DocConsumer.cs
-../../../external/Lucene.Net/src/core/Index/DocConsumerPerThread.cs
-../../../external/Lucene.Net/src/core/Index/DocFieldConsumer.cs
-../../../external/Lucene.Net/src/core/Index/DocFieldConsumerPerField.cs
-../../../external/Lucene.Net/src/core/Index/DocFieldConsumerPerThread.cs
-../../../external/Lucene.Net/src/core/Index/DocFieldConsumers.cs
-../../../external/Lucene.Net/src/core/Index/DocFieldConsumersPerField.cs
-../../../external/Lucene.Net/src/core/Index/DocFieldConsumersPerThread.cs
-../../../external/Lucene.Net/src/core/Index/DocFieldProcessor.cs
-../../../external/Lucene.Net/src/core/Index/DocFieldProcessorPerField.cs
-../../../external/Lucene.Net/src/core/Index/DocFieldProcessorPerThread.cs
-../../../external/Lucene.Net/src/core/Index/DocInverter.cs
-../../../external/Lucene.Net/src/core/Index/DocInverterPerField.cs
-../../../external/Lucene.Net/src/core/Index/DocInverterPerThread.cs
-../../../external/Lucene.Net/src/core/Index/DocumentsWriter.cs
-../../../external/Lucene.Net/src/core/Index/DocumentsWriterThreadState.cs
-../../../external/Lucene.Net/src/core/Index/FieldInfo.cs
-../../../external/Lucene.Net/src/core/Index/FieldInfos.cs
-../../../external/Lucene.Net/src/core/Index/FieldInvertState.cs
-../../../external/Lucene.Net/src/core/Index/FieldReaderException.cs
-../../../external/Lucene.Net/src/core/Index/FieldSortedTermVectorMapper.cs
-../../../external/Lucene.Net/src/core/Index/FieldsReader.cs
-../../../external/Lucene.Net/src/core/Index/FieldsWriter.cs
-../../../external/Lucene.Net/src/core/Index/FilterIndexReader.cs
-../../../external/Lucene.Net/src/core/Index/FormatPostingsDocsConsumer.cs
-../../../external/Lucene.Net/src/core/Index/FormatPostingsDocsWriter.cs
-../../../external/Lucene.Net/src/core/Index/FormatPostingsFieldsConsumer.cs
-../../../external/Lucene.Net/src/core/Index/FormatPostingsFieldsWriter.cs
-../../../external/Lucene.Net/src/core/Index/FormatPostingsPositionsConsumer.cs
-../../../external/Lucene.Net/src/core/Index/FormatPostingsPositionsWriter.cs
-../../../external/Lucene.Net/src/core/Index/FormatPostingsTermsConsumer.cs
-../../../external/Lucene.Net/src/core/Index/FormatPostingsTermsWriter.cs
-../../../external/Lucene.Net/src/core/Index/FreqProxFieldMergeState.cs
-../../../external/Lucene.Net/src/core/Index/FreqProxTermsWriter.cs
-../../../external/Lucene.Net/src/core/Index/FreqProxTermsWriterPerField.cs
-../../../external/Lucene.Net/src/core/Index/FreqProxTermsWriterPerThread.cs
-../../../external/Lucene.Net/src/core/Index/IndexCommit.cs
-../../../external/Lucene.Net/src/core/Index/IndexDeletionPolicy.cs
-../../../external/Lucene.Net/src/core/Index/IndexFileDeleter.cs
-../../../external/Lucene.Net/src/core/Index/IndexFileNameFilter.cs
-../../../external/Lucene.Net/src/core/Index/IndexFileNames.cs
-../../../external/Lucene.Net/src/core/Index/IndexReader.cs
-../../../external/Lucene.Net/src/core/Index/IndexWriter.cs
-../../../external/Lucene.Net/src/core/Index/IntBlockPool.cs
-../../../external/Lucene.Net/src/core/Index/InvertedDocConsumer.cs
-../../../external/Lucene.Net/src/core/Index/InvertedDocConsumerPerField.cs
-../../../external/Lucene.Net/src/core/Index/InvertedDocConsumerPerThread.cs
-../../../external/Lucene.Net/src/core/Index/InvertedDocEndConsumer.cs
-../../../external/Lucene.Net/src/core/Index/InvertedDocEndConsumerPerField.cs
-../../../external/Lucene.Net/src/core/Index/InvertedDocEndConsumerPerThread.cs
-../../../external/Lucene.Net/src/core/Index/KeepOnlyLastCommitDeletionPolicy.cs
-../../../external/Lucene.Net/src/core/Index/LogByteSizeMergePolicy.cs
-../../../external/Lucene.Net/src/core/Index/LogDocMergePolicy.cs
-../../../external/Lucene.Net/src/core/Index/LogMergePolicy.cs
-../../../external/Lucene.Net/src/core/Index/MergeDocIDRemapper.cs
-../../../external/Lucene.Net/src/core/Index/MergePolicy.cs
-../../../external/Lucene.Net/src/core/Index/MergeScheduler.cs
-../../../external/Lucene.Net/src/core/Index/MultiLevelSkipListReader.cs
-../../../external/Lucene.Net/src/core/Index/MultiLevelSkipListWriter.cs
-../../../external/Lucene.Net/src/core/Index/MultipleTermPositions.cs
-../../../external/Lucene.Net/src/core/Index/MultiReader.cs
-../../../external/Lucene.Net/src/core/Index/NormsWriter.cs
-../../../external/Lucene.Net/src/core/Index/NormsWriterPerField.cs
-../../../external/Lucene.Net/src/core/Index/NormsWriterPerThread.cs
-../../../external/Lucene.Net/src/core/Index/ParallelReader.cs
-../../../external/Lucene.Net/src/core/Index/Payload.cs
-../../../external/Lucene.Net/src/core/Index/PositionBasedTermVectorMapper.cs
-../../../external/Lucene.Net/src/core/Index/RawPostingList.cs
-../../../external/Lucene.Net/src/core/Index/ReadOnlyDirectoryReader.cs
-../../../external/Lucene.Net/src/core/Index/ReadOnlySegmentReader.cs
-../../../external/Lucene.Net/src/core/Index/ReusableStringReader.cs
-../../../external/Lucene.Net/src/core/Index/SegmentInfo.cs
-../../../external/Lucene.Net/src/core/Index/SegmentInfos.cs
-../../../external/Lucene.Net/src/core/Index/SegmentMergeInfo.cs
-../../../external/Lucene.Net/src/core/Index/SegmentMergeQueue.cs
-../../../external/Lucene.Net/src/core/Index/SegmentMerger.cs
-../../../external/Lucene.Net/src/core/Index/SegmentReader.cs
-../../../external/Lucene.Net/src/core/Index/SegmentTermDocs.cs
-../../../external/Lucene.Net/src/core/Index/SegmentTermEnum.cs
-../../../external/Lucene.Net/src/core/Index/SegmentTermPositions.cs
-../../../external/Lucene.Net/src/core/Index/SegmentTermPositionVector.cs
-../../../external/Lucene.Net/src/core/Index/SegmentTermVector.cs
-../../../external/Lucene.Net/src/core/Index/SegmentWriteState.cs
-../../../external/Lucene.Net/src/core/Index/SerialMergeScheduler.cs
-../../../external/Lucene.Net/src/core/Index/SnapshotDeletionPolicy.cs
-../../../external/Lucene.Net/src/core/Index/SortedTermVectorMapper.cs
-../../../external/Lucene.Net/src/core/Index/StaleReaderException.cs
-../../../external/Lucene.Net/src/core/Index/StoredFieldsWriter.cs
-../../../external/Lucene.Net/src/core/Index/StoredFieldsWriterPerThread.cs
-../../../external/Lucene.Net/src/core/Index/Term.cs
-../../../external/Lucene.Net/src/core/Index/TermBuffer.cs
-../../../external/Lucene.Net/src/core/Index/TermDocs.cs
-../../../external/Lucene.Net/src/core/Index/TermEnum.cs
-../../../external/Lucene.Net/src/core/Index/TermFreqVector.cs
-../../../external/Lucene.Net/src/core/Index/TermInfo.cs
-../../../external/Lucene.Net/src/core/Index/TermInfosReader.cs
-../../../external/Lucene.Net/src/core/Index/TermInfosWriter.cs
-../../../external/Lucene.Net/src/core/Index/TermPositions.cs
-../../../external/Lucene.Net/src/core/Index/TermPositionVector.cs
-../../../external/Lucene.Net/src/core/Index/TermsHash.cs
-../../../external/Lucene.Net/src/core/Index/TermsHashConsumer.cs
-../../../external/Lucene.Net/src/core/Index/TermsHashConsumerPerField.cs
-../../../external/Lucene.Net/src/core/Index/TermsHashConsumerPerThread.cs
-../../../external/Lucene.Net/src/core/Index/TermsHashPerField.cs
-../../../external/Lucene.Net/src/core/Index/TermsHashPerThread.cs
-../../../external/Lucene.Net/src/core/Index/TermVectorEntry.cs
-../../../external/Lucene.Net/src/core/Index/TermVectorEntryFreqSortedComparator.cs
-../../../external/Lucene.Net/src/core/Index/TermVectorMapper.cs
-../../../external/Lucene.Net/src/core/Index/TermVectorOffsetInfo.cs
-../../../external/Lucene.Net/src/core/Index/TermVectorsReader.cs
-../../../external/Lucene.Net/src/core/Index/TermVectorsTermsWriter.cs
-../../../external/Lucene.Net/src/core/Index/TermVectorsTermsWriterPerField.cs
-../../../external/Lucene.Net/src/core/Index/TermVectorsTermsWriterPerThread.cs
-../../../external/Lucene.Net/src/core/Index/TermVectorsWriter.cs
-../../../external/Lucene.Net/src/core/LucenePackage.cs
-../../../external/Lucene.Net/src/core/LZOCompressor.cs
-../../../external/Lucene.Net/src/core/Messages/INLSException.cs
-../../../external/Lucene.Net/src/core/Messages/Message.cs
-../../../external/Lucene.Net/src/core/Messages/MessageImpl.cs
-../../../external/Lucene.Net/src/core/Messages/NLS.cs
-../../../external/Lucene.Net/src/core/QueryParser/CharStream.cs
-../../../external/Lucene.Net/src/core/QueryParser/FastCharStream.cs
-../../../external/Lucene.Net/src/core/QueryParser/MultiFieldQueryParser.cs
-../../../external/Lucene.Net/src/core/QueryParser/ParseException.cs
-../../../external/Lucene.Net/src/core/QueryParser/QueryParser.cs
-../../../external/Lucene.Net/src/core/QueryParser/QueryParserConstants.cs
-../../../external/Lucene.Net/src/core/QueryParser/QueryParserTokenManager.cs
-../../../external/Lucene.Net/src/core/QueryParser/Token.cs
-../../../external/Lucene.Net/src/core/QueryParser/TokenMgrError.cs
-../../../external/Lucene.Net/src/core/Search/BooleanClause.cs
-../../../external/Lucene.Net/src/core/Search/BooleanQuery.cs
-../../../external/Lucene.Net/src/core/Search/BooleanScorer.cs
-../../../external/Lucene.Net/src/core/Search/BooleanScorer2.cs
-../../../external/Lucene.Net/src/core/Search/CachingSpanFilter.cs
-../../../external/Lucene.Net/src/core/Search/CachingWrapperFilter.cs
-../../../external/Lucene.Net/src/core/Search/Collector.cs
-../../../external/Lucene.Net/src/core/Search/ComplexExplanation.cs
-../../../external/Lucene.Net/src/core/Search/ConjunctionScorer.cs
-../../../external/Lucene.Net/src/core/Search/ConstantScoreQuery.cs
-../../../external/Lucene.Net/src/core/Search/DefaultSimilarity.cs
-../../../external/Lucene.Net/src/core/Search/DisjunctionMaxQuery.cs
-../../../external/Lucene.Net/src/core/Search/DisjunctionMaxScorer.cs
-../../../external/Lucene.Net/src/core/Search/DisjunctionSumScorer.cs
-../../../external/Lucene.Net/src/core/Search/DocIdSet.cs
-../../../external/Lucene.Net/src/core/Search/DocIdSetIterator.cs
-../../../external/Lucene.Net/src/core/Search/ExactPhraseScorer.cs
-../../../external/Lucene.Net/src/core/Search/Explanation.cs
-../../../external/Lucene.Net/src/core/Search/FieldCache.cs
-../../../external/Lucene.Net/src/core/Search/FieldCacheImpl.cs
-../../../external/Lucene.Net/src/core/Search/FieldCacheRangeFilter.cs
-../../../external/Lucene.Net/src/core/Search/FieldCacheTermsFilter.cs
-../../../external/Lucene.Net/src/core/Search/FieldComparator.cs
-../../../external/Lucene.Net/src/core/Search/FieldComparatorSource.cs
-../../../external/Lucene.Net/src/core/Search/FieldDoc.cs
-../../../external/Lucene.Net/src/core/Search/FieldDocSortedHitQueue.cs
-../../../external/Lucene.Net/src/core/Search/FieldValueHitQueue.cs
-../../../external/Lucene.Net/src/core/Search/Filter.cs
-../../../external/Lucene.Net/src/core/Search/FilteredDocIdSet.cs
-../../../external/Lucene.Net/src/core/Search/FilteredDocIdSetIterator.cs
-../../../external/Lucene.Net/src/core/Search/FilteredQuery.cs
-../../../external/Lucene.Net/src/core/Search/FilteredTermEnum.cs
-../../../external/Lucene.Net/src/core/Search/FilterManager.cs
-../../../external/Lucene.Net/src/core/Search/Function/ByteFieldSource.cs
-../../../external/Lucene.Net/src/core/Search/Function/CustomScoreProvider.cs
-../../../external/Lucene.Net/src/core/Search/Function/CustomScoreQuery.cs
-../../../external/Lucene.Net/src/core/Search/Function/DocValues.cs
-../../../external/Lucene.Net/src/core/Search/Function/FieldCacheSource.cs
-../../../external/Lucene.Net/src/core/Search/Function/FieldScoreQuery.cs
-../../../external/Lucene.Net/src/core/Search/Function/FloatFieldSource.cs
-../../../external/Lucene.Net/src/core/Search/Function/IntFieldSource.cs
-../../../external/Lucene.Net/src/core/Search/Function/OrdFieldSource.cs
-../../../external/Lucene.Net/src/core/Search/Function/ReverseOrdFieldSource.cs
-../../../external/Lucene.Net/src/core/Search/Function/ShortFieldSource.cs
-../../../external/Lucene.Net/src/core/Search/Function/ValueSource.cs
-../../../external/Lucene.Net/src/core/Search/Function/ValueSourceQuery.cs
-../../../external/Lucene.Net/src/core/Search/FuzzyQuery.cs
-../../../external/Lucene.Net/src/core/Search/FuzzyTermEnum.cs
-../../../external/Lucene.Net/src/core/Search/HitQueue.cs
-../../../external/Lucene.Net/src/core/Search/IndexSearcher.cs
-../../../external/Lucene.Net/src/core/Search/MatchAllDocsQuery.cs
-../../../external/Lucene.Net/src/core/Search/MultiPhraseQuery.cs
-../../../external/Lucene.Net/src/core/Search/MultiSearcher.cs
-../../../external/Lucene.Net/src/core/Search/MultiTermQuery.cs
-../../../external/Lucene.Net/src/core/Search/MultiTermQueryWrapperFilter.cs
-../../../external/Lucene.Net/src/core/Search/NumericRangeFilter.cs
-../../../external/Lucene.Net/src/core/Search/NumericRangeQuery.cs
-../../../external/Lucene.Net/src/core/Search/ParallelMultiSearcher.cs
-../../../external/Lucene.Net/src/core/Search/Payloads/AveragePayloadFunction.cs
-../../../external/Lucene.Net/src/core/Search/Payloads/MaxPayloadFunction.cs
-../../../external/Lucene.Net/src/core/Search/Payloads/MinPayloadFunction.cs
-../../../external/Lucene.Net/src/core/Search/Payloads/PayloadFunction.cs
-../../../external/Lucene.Net/src/core/Search/Payloads/PayloadNearQuery.cs
-../../../external/Lucene.Net/src/core/Search/Payloads/PayloadSpanUtil.cs
-../../../external/Lucene.Net/src/core/Search/Payloads/PayloadTermQuery.cs
-../../../external/Lucene.Net/src/core/Search/PhrasePositions.cs
-../../../external/Lucene.Net/src/core/Search/PhraseQuery.cs
-../../../external/Lucene.Net/src/core/Search/PhraseQueue.cs
-../../../external/Lucene.Net/src/core/Search/PhraseScorer.cs
-../../../external/Lucene.Net/src/core/Search/PositiveScoresOnlyCollector.cs
-../../../external/Lucene.Net/src/core/Search/PrefixFilter.cs
-../../../external/Lucene.Net/src/core/Search/PrefixQuery.cs
-../../../external/Lucene.Net/src/core/Search/PrefixTermEnum.cs
-../../../external/Lucene.Net/src/core/Search/Query.cs
-../../../external/Lucene.Net/src/core/Search/QueryTermVector.cs
-../../../external/Lucene.Net/src/core/Search/QueryWrapperFilter.cs
-../../../external/Lucene.Net/src/core/Search/ReqExclScorer.cs
-../../../external/Lucene.Net/src/core/Search/ReqOptSumScorer.cs
-../../../external/Lucene.Net/src/core/Search/ScoreCachingWrappingScorer.cs
-../../../external/Lucene.Net/src/core/Search/ScoreDoc.cs
-../../../external/Lucene.Net/src/core/Search/Scorer.cs
-../../../external/Lucene.Net/src/core/Search/Searchable.cs
-../../../external/Lucene.Net/src/core/Search/Searcher.cs
-../../../external/Lucene.Net/src/core/Search/Similarity.cs
-../../../external/Lucene.Net/src/core/Search/SimilarityDelegator.cs
-../../../external/Lucene.Net/src/core/Search/SingleTermEnum.cs
-../../../external/Lucene.Net/src/core/Search/SloppyPhraseScorer.cs
-../../../external/Lucene.Net/src/core/Search/Sort.cs
-../../../external/Lucene.Net/src/core/Search/SortField.cs
-../../../external/Lucene.Net/src/core/Search/SpanFilter.cs
-../../../external/Lucene.Net/src/core/Search/SpanFilterResult.cs
-../../../external/Lucene.Net/src/core/Search/SpanQueryFilter.cs
-../../../external/Lucene.Net/src/core/Search/Spans/FieldMaskingSpanQuery.cs
-../../../external/Lucene.Net/src/core/Search/Spans/NearSpansOrdered.cs
-../../../external/Lucene.Net/src/core/Search/Spans/NearSpansUnordered.cs
-../../../external/Lucene.Net/src/core/Search/Spans/SpanFirstQuery.cs
-../../../external/Lucene.Net/src/core/Search/Spans/SpanNearQuery.cs
-../../../external/Lucene.Net/src/core/Search/Spans/SpanNotQuery.cs
-../../../external/Lucene.Net/src/core/Search/Spans/SpanOrQuery.cs
-../../../external/Lucene.Net/src/core/Search/Spans/SpanQuery.cs
-../../../external/Lucene.Net/src/core/Search/Spans/Spans.cs
-../../../external/Lucene.Net/src/core/Search/Spans/SpanScorer.cs
-../../../external/Lucene.Net/src/core/Search/Spans/SpanTermQuery.cs
-../../../external/Lucene.Net/src/core/Search/Spans/SpanWeight.cs
-../../../external/Lucene.Net/src/core/Search/Spans/TermSpans.cs
-../../../external/Lucene.Net/src/core/Search/TermQuery.cs
-../../../external/Lucene.Net/src/core/Search/TermRangeFilter.cs
-../../../external/Lucene.Net/src/core/Search/TermRangeQuery.cs
-../../../external/Lucene.Net/src/core/Search/TermRangeTermEnum.cs
-../../../external/Lucene.Net/src/core/Search/TermScorer.cs
-../../../external/Lucene.Net/src/core/Search/TimeLimitingCollector.cs
-../../../external/Lucene.Net/src/core/Search/TopDocs.cs
-../../../external/Lucene.Net/src/core/Search/TopDocsCollector.cs
-../../../external/Lucene.Net/src/core/Search/TopFieldCollector.cs
-../../../external/Lucene.Net/src/core/Search/TopFieldDocs.cs
-../../../external/Lucene.Net/src/core/Search/TopScoreDocCollector.cs
-../../../external/Lucene.Net/src/core/Search/Weight.cs
-../../../external/Lucene.Net/src/core/Search/WildcardQuery.cs
-../../../external/Lucene.Net/src/core/Search/WildcardTermEnum.cs
-../../../external/Lucene.Net/src/core/Store/AlreadyClosedException.cs
-../../../external/Lucene.Net/src/core/Store/BufferedIndexInput.cs
-../../../external/Lucene.Net/src/core/Store/BufferedIndexOutput.cs
-../../../external/Lucene.Net/src/core/Store/CheckSumIndexInput.cs
-../../../external/Lucene.Net/src/core/Store/CheckSumIndexOutput.cs
-../../../external/Lucene.Net/src/core/Store/Directory.cs
-../../../external/Lucene.Net/src/core/Store/FileSwitchDirectory.cs
-../../../external/Lucene.Net/src/core/Store/FSDirectory.cs
-../../../external/Lucene.Net/src/core/Store/FSLockFactory.cs
-../../../external/Lucene.Net/src/core/Store/IndexInput.cs
-../../../external/Lucene.Net/src/core/Store/IndexOutput.cs
-../../../external/Lucene.Net/src/core/Store/Lock.cs
-../../../external/Lucene.Net/src/core/Store/LockFactory.cs
-../../../external/Lucene.Net/src/core/Store/LockObtainFailedException.cs
-../../../external/Lucene.Net/src/core/Store/LockReleaseFailedException.cs
-../../../external/Lucene.Net/src/core/Store/LockStressTest.cs
-../../../external/Lucene.Net/src/core/Store/LockVerifyServer.cs
-../../../external/Lucene.Net/src/core/Store/MMapDirectory.cs
-../../../external/Lucene.Net/src/core/Store/NativeFSLockFactory.cs
-../../../external/Lucene.Net/src/core/Store/NIOFSDirectory.cs
-../../../external/Lucene.Net/src/core/Store/NoLockFactory.cs
-../../../external/Lucene.Net/src/core/Store/NoSuchDirectoryException.cs
-../../../external/Lucene.Net/src/core/Store/RAMDirectory.cs
-../../../external/Lucene.Net/src/core/Store/RAMFile.cs
-../../../external/Lucene.Net/src/core/Store/RAMInputStream.cs
-../../../external/Lucene.Net/src/core/Store/RAMOutputStream.cs
-../../../external/Lucene.Net/src/core/Store/SimpleFSDirectory.cs
-../../../external/Lucene.Net/src/core/Store/SimpleFSLockFactory.cs
-../../../external/Lucene.Net/src/core/Store/SingleInstanceLockFactory.cs
-../../../external/Lucene.Net/src/core/Store/VerifyingLockFactory.cs
-../../../external/Lucene.Net/src/core/Support/AppSettings.cs
-../../../external/Lucene.Net/src/core/Support/AttributeImplItem.cs
-../../../external/Lucene.Net/src/core/Support/BitSetSupport.cs
-../../../external/Lucene.Net/src/core/Support/BuildType.cs
-../../../external/Lucene.Net/src/core/Support/Character.cs
-../../../external/Lucene.Net/src/core/Support/CloseableThreadLocalProfiler.cs
-../../../external/Lucene.Net/src/core/Support/CollectionsHelper.cs
-../../../external/Lucene.Net/src/core/Support/Compare.cs
-../../../external/Lucene.Net/src/core/Support/Compatibility/ConcurrentDictionary.cs
-../../../external/Lucene.Net/src/core/Support/Compatibility/Func.cs
-../../../external/Lucene.Net/src/core/Support/Compatibility/ISet.cs
-../../../external/Lucene.Net/src/core/Support/Compatibility/SetFactory.cs
-../../../external/Lucene.Net/src/core/Support/Compatibility/SortedSet.cs
-../../../external/Lucene.Net/src/core/Support/Compatibility/ThreadLocal.cs
-../../../external/Lucene.Net/src/core/Support/Compatibility/WrappedHashSet.cs
-../../../external/Lucene.Net/src/core/Support/CRC32.cs
-../../../external/Lucene.Net/src/core/Support/Cryptography.cs
-../../../external/Lucene.Net/src/core/Support/Deflater.cs
-../../../external/Lucene.Net/src/core/Support/Double.cs
-../../../external/Lucene.Net/src/core/Support/EquatableList.cs
-../../../external/Lucene.Net/src/core/Support/FileSupport.cs
-../../../external/Lucene.Net/src/core/Support/GeneralKeyedCollection.cs
-../../../external/Lucene.Net/src/core/Support/HashMap.cs
-../../../external/Lucene.Net/src/core/Support/IChecksum.cs
-../../../external/Lucene.Net/src/core/Support/Inflater.cs
-../../../external/Lucene.Net/src/core/Support/IThreadRunnable.cs
-../../../external/Lucene.Net/src/core/Support/Number.cs
-../../../external/Lucene.Net/src/core/Support/OS.cs
-../../../external/Lucene.Net/src/core/Support/SharpZipLib.cs
-../../../external/Lucene.Net/src/core/Support/Single.cs
-../../../external/Lucene.Net/src/core/Support/TextSupport.cs
-../../../external/Lucene.Net/src/core/Support/ThreadClass.cs
-../../../external/Lucene.Net/src/core/Support/ThreadLock.cs
-../../../external/Lucene.Net/src/core/Support/WeakDictionary.cs
-../../../external/Lucene.Net/src/core/Util/ArrayUtil.cs
-../../../external/Lucene.Net/src/core/Util/Attribute.cs
-../../../external/Lucene.Net/src/core/Util/AttributeSource.cs
-../../../external/Lucene.Net/src/core/Util/AverageGuessMemoryModel.cs
-../../../external/Lucene.Net/src/core/Util/BitUtil.cs
-../../../external/Lucene.Net/src/core/Util/BitVector.cs
-../../../external/Lucene.Net/src/core/Util/Cache/Cache.cs
-../../../external/Lucene.Net/src/core/Util/Cache/SimpleLRUCache.cs
-../../../external/Lucene.Net/src/core/Util/Cache/SimpleMapCache.cs
-../../../external/Lucene.Net/src/core/Util/CloseableThreadLocal.cs
-../../../external/Lucene.Net/src/core/Util/Constants.cs
-../../../external/Lucene.Net/src/core/Util/DocIdBitSet.cs
-../../../external/Lucene.Net/src/core/Util/FieldCacheSanityChecker.cs
-../../../external/Lucene.Net/src/core/Util/IAttribute.cs
-../../../external/Lucene.Net/src/core/Util/IdentityDictionary.cs
-../../../external/Lucene.Net/src/core/Util/IndexableBinaryStringTools.cs
-../../../external/Lucene.Net/src/core/Util/MapOfSets.cs
-../../../external/Lucene.Net/src/core/Util/MemoryModel.cs
-../../../external/Lucene.Net/src/core/Util/NumericUtils.cs
-../../../external/Lucene.Net/src/core/Util/OpenBitSet.cs
-../../../external/Lucene.Net/src/core/Util/OpenBitSetDISI.cs
-../../../external/Lucene.Net/src/core/Util/OpenBitSetIterator.cs
-../../../external/Lucene.Net/src/core/Util/PriorityQueue.cs
-../../../external/Lucene.Net/src/core/Util/RamUsageEstimator.cs
-../../../external/Lucene.Net/src/core/Util/ReaderUtil.cs
-../../../external/Lucene.Net/src/core/Util/ScorerDocQueue.cs
-../../../external/Lucene.Net/src/core/Util/SimpleStringInterner.cs
-../../../external/Lucene.Net/src/core/Util/SmallFloat.cs
-../../../external/Lucene.Net/src/core/Util/SortedVIntList.cs
-../../../external/Lucene.Net/src/core/Util/SorterTemplate.cs
-../../../external/Lucene.Net/src/core/Util/StringHelper.cs
-../../../external/Lucene.Net/src/core/Util/StringInterner.cs
-../../../external/Lucene.Net/src/core/Util/ToStringUtils.cs
-../../../external/Lucene.Net/src/core/Util/UnicodeUtil.cs
-../../../external/Lucene.Net/src/core/Util/Version.cs
+../../../external/Lucene.Net.Light/src/core/Analysis/Analyzer.cs
+../../../external/Lucene.Net.Light/src/core/Analysis/ASCIIFoldingFilter.cs
+../../../external/Lucene.Net.Light/src/core/Analysis/BaseCharFilter.cs
+../../../external/Lucene.Net.Light/src/core/Analysis/CachingTokenFilter.cs
+../../../external/Lucene.Net.Light/src/core/Analysis/CharArraySet.cs
+../../../external/Lucene.Net.Light/src/core/Analysis/CharFilter.cs
+../../../external/Lucene.Net.Light/src/core/Analysis/CharReader.cs
+../../../external/Lucene.Net.Light/src/core/Analysis/CharStream.cs
+../../../external/Lucene.Net.Light/src/core/Analysis/CharTokenizer.cs
+../../../external/Lucene.Net.Light/src/core/Analysis/ISOLatin1AccentFilter.cs
+../../../external/Lucene.Net.Light/src/core/Analysis/KeywordAnalyzer.cs
+../../../external/Lucene.Net.Light/src/core/Analysis/KeywordTokenizer.cs
+../../../external/Lucene.Net.Light/src/core/Analysis/LengthFilter.cs
+../../../external/Lucene.Net.Light/src/core/Analysis/LetterTokenizer.cs
+../../../external/Lucene.Net.Light/src/core/Analysis/LowerCaseFilter.cs
+../../../external/Lucene.Net.Light/src/core/Analysis/LowerCaseTokenizer.cs
+../../../external/Lucene.Net.Light/src/core/Analysis/MappingCharFilter.cs
+../../../external/Lucene.Net.Light/src/core/Analysis/NormalizeCharMap.cs
+../../../external/Lucene.Net.Light/src/core/Analysis/NumericTokenStream.cs
+../../../external/Lucene.Net.Light/src/core/Analysis/PerFieldAnalyzerWrapper.cs
+../../../external/Lucene.Net.Light/src/core/Analysis/PorterStemFilter.cs
+../../../external/Lucene.Net.Light/src/core/Analysis/PorterStemmer.cs
+../../../external/Lucene.Net.Light/src/core/Analysis/SimpleAnalyzer.cs
+../../../external/Lucene.Net.Light/src/core/Analysis/Standard/StandardAnalyzer.cs
+../../../external/Lucene.Net.Light/src/core/Analysis/Standard/StandardFilter.cs
+../../../external/Lucene.Net.Light/src/core/Analysis/Standard/StandardTokenizer.cs
+../../../external/Lucene.Net.Light/src/core/Analysis/Standard/StandardTokenizerImpl.cs
+../../../external/Lucene.Net.Light/src/core/Analysis/StopAnalyzer.cs
+../../../external/Lucene.Net.Light/src/core/Analysis/StopFilter.cs
+../../../external/Lucene.Net.Light/src/core/Analysis/TeeSinkTokenFilter.cs
+../../../external/Lucene.Net.Light/src/core/Analysis/Token.cs
+../../../external/Lucene.Net.Light/src/core/Analysis/Tokenattributes/FlagsAttribute.cs
+../../../external/Lucene.Net.Light/src/core/Analysis/Tokenattributes/IFlagsAttribute.cs
+../../../external/Lucene.Net.Light/src/core/Analysis/Tokenattributes/IOffsetAttribute.cs
+../../../external/Lucene.Net.Light/src/core/Analysis/Tokenattributes/IPayloadAttribute.cs
+../../../external/Lucene.Net.Light/src/core/Analysis/Tokenattributes/IPositionIncrementAttribute.cs
+../../../external/Lucene.Net.Light/src/core/Analysis/Tokenattributes/ITermAttribute.cs
+../../../external/Lucene.Net.Light/src/core/Analysis/Tokenattributes/ITypeAttribute.cs
+../../../external/Lucene.Net.Light/src/core/Analysis/Tokenattributes/OffsetAttribute.cs
+../../../external/Lucene.Net.Light/src/core/Analysis/Tokenattributes/PayloadAttribute.cs
+../../../external/Lucene.Net.Light/src/core/Analysis/Tokenattributes/PositionIncrementAttribute.cs
+../../../external/Lucene.Net.Light/src/core/Analysis/Tokenattributes/TermAttribute.cs
+../../../external/Lucene.Net.Light/src/core/Analysis/Tokenattributes/TypeAttribute.cs
+../../../external/Lucene.Net.Light/src/core/Analysis/TokenFilter.cs
+../../../external/Lucene.Net.Light/src/core/Analysis/Tokenizer.cs
+../../../external/Lucene.Net.Light/src/core/Analysis/TokenStream.cs
+../../../external/Lucene.Net.Light/src/core/Analysis/WhitespaceAnalyzer.cs
+../../../external/Lucene.Net.Light/src/core/Analysis/WhitespaceTokenizer.cs
+../../../external/Lucene.Net.Light/src/core/Analysis/WordlistLoader.cs
+../../../external/Lucene.Net.Light/src/core/Document/AbstractField.cs
+../../../external/Lucene.Net.Light/src/core/Document/CompressionTools.cs
+../../../external/Lucene.Net.Light/src/core/Document/DateField.cs
+../../../external/Lucene.Net.Light/src/core/Document/DateTools.cs
+../../../external/Lucene.Net.Light/src/core/Document/Document.cs
+../../../external/Lucene.Net.Light/src/core/Document/Field.cs
+../../../external/Lucene.Net.Light/src/core/Document/Fieldable.cs
+../../../external/Lucene.Net.Light/src/core/Document/FieldSelector.cs
+../../../external/Lucene.Net.Light/src/core/Document/FieldSelectorResult.cs
+../../../external/Lucene.Net.Light/src/core/Document/LoadFirstFieldSelector.cs
+../../../external/Lucene.Net.Light/src/core/Document/MapFieldSelector.cs
+../../../external/Lucene.Net.Light/src/core/Document/NumberTools.cs
+../../../external/Lucene.Net.Light/src/core/Document/NumericField.cs
+../../../external/Lucene.Net.Light/src/core/Document/SetBasedFieldSelector.cs
+../../../external/Lucene.Net.Light/src/core/Index/AbstractAllTermDocs.cs
+../../../external/Lucene.Net.Light/src/core/Index/AllTermDocs.cs
+../../../external/Lucene.Net.Light/src/core/Index/BufferedDeletes.cs
+../../../external/Lucene.Net.Light/src/core/Index/ByteBlockPool.cs
+../../../external/Lucene.Net.Light/src/core/Index/ByteSliceReader.cs
+../../../external/Lucene.Net.Light/src/core/Index/ByteSliceWriter.cs
+../../../external/Lucene.Net.Light/src/core/Index/CharBlockPool.cs
+../../../external/Lucene.Net.Light/src/core/Index/CheckIndex.cs
+../../../external/Lucene.Net.Light/src/core/Index/CompoundFileReader.cs
+../../../external/Lucene.Net.Light/src/core/Index/CompoundFileWriter.cs
+../../../external/Lucene.Net.Light/src/core/Index/ConcurrentMergeScheduler.cs
+../../../external/Lucene.Net.Light/src/core/Index/CorruptIndexException.cs
+../../../external/Lucene.Net.Light/src/core/Index/DefaultSkipListReader.cs
+../../../external/Lucene.Net.Light/src/core/Index/DefaultSkipListWriter.cs
+../../../external/Lucene.Net.Light/src/core/Index/DirectoryReader.cs
+../../../external/Lucene.Net.Light/src/core/Index/DocConsumer.cs
+../../../external/Lucene.Net.Light/src/core/Index/DocConsumerPerThread.cs
+../../../external/Lucene.Net.Light/src/core/Index/DocFieldConsumer.cs
+../../../external/Lucene.Net.Light/src/core/Index/DocFieldConsumerPerField.cs
+../../../external/Lucene.Net.Light/src/core/Index/DocFieldConsumerPerThread.cs
+../../../external/Lucene.Net.Light/src/core/Index/DocFieldConsumers.cs
+../../../external/Lucene.Net.Light/src/core/Index/DocFieldConsumersPerField.cs
+../../../external/Lucene.Net.Light/src/core/Index/DocFieldConsumersPerThread.cs
+../../../external/Lucene.Net.Light/src/core/Index/DocFieldProcessor.cs
+../../../external/Lucene.Net.Light/src/core/Index/DocFieldProcessorPerField.cs
+../../../external/Lucene.Net.Light/src/core/Index/DocFieldProcessorPerThread.cs
+../../../external/Lucene.Net.Light/src/core/Index/DocInverter.cs
+../../../external/Lucene.Net.Light/src/core/Index/DocInverterPerField.cs
+../../../external/Lucene.Net.Light/src/core/Index/DocInverterPerThread.cs
+../../../external/Lucene.Net.Light/src/core/Index/DocumentsWriter.cs
+../../../external/Lucene.Net.Light/src/core/Index/DocumentsWriterThreadState.cs
+../../../external/Lucene.Net.Light/src/core/Index/FieldInfo.cs
+../../../external/Lucene.Net.Light/src/core/Index/FieldInfos.cs
+../../../external/Lucene.Net.Light/src/core/Index/FieldInvertState.cs
+../../../external/Lucene.Net.Light/src/core/Index/FieldReaderException.cs
+../../../external/Lucene.Net.Light/src/core/Index/FieldSortedTermVectorMapper.cs
+../../../external/Lucene.Net.Light/src/core/Index/FieldsReader.cs
+../../../external/Lucene.Net.Light/src/core/Index/FieldsWriter.cs
+../../../external/Lucene.Net.Light/src/core/Index/FilterIndexReader.cs
+../../../external/Lucene.Net.Light/src/core/Index/FormatPostingsDocsConsumer.cs
+../../../external/Lucene.Net.Light/src/core/Index/FormatPostingsDocsWriter.cs
+../../../external/Lucene.Net.Light/src/core/Index/FormatPostingsFieldsConsumer.cs
+../../../external/Lucene.Net.Light/src/core/Index/FormatPostingsFieldsWriter.cs
+../../../external/Lucene.Net.Light/src/core/Index/FormatPostingsPositionsConsumer.cs
+../../../external/Lucene.Net.Light/src/core/Index/FormatPostingsPositionsWriter.cs
+../../../external/Lucene.Net.Light/src/core/Index/FormatPostingsTermsConsumer.cs
+../../../external/Lucene.Net.Light/src/core/Index/FormatPostingsTermsWriter.cs
+../../../external/Lucene.Net.Light/src/core/Index/FreqProxFieldMergeState.cs
+../../../external/Lucene.Net.Light/src/core/Index/FreqProxTermsWriter.cs
+../../../external/Lucene.Net.Light/src/core/Index/FreqProxTermsWriterPerField.cs
+../../../external/Lucene.Net.Light/src/core/Index/FreqProxTermsWriterPerThread.cs
+../../../external/Lucene.Net.Light/src/core/Index/IndexCommit.cs
+../../../external/Lucene.Net.Light/src/core/Index/IndexDeletionPolicy.cs
+../../../external/Lucene.Net.Light/src/core/Index/IndexFileDeleter.cs
+../../../external/Lucene.Net.Light/src/core/Index/IndexFileNameFilter.cs
+../../../external/Lucene.Net.Light/src/core/Index/IndexFileNames.cs
+../../../external/Lucene.Net.Light/src/core/Index/IndexReader.cs
+../../../external/Lucene.Net.Light/src/core/Index/IndexWriter.cs
+../../../external/Lucene.Net.Light/src/core/Index/IntBlockPool.cs
+../../../external/Lucene.Net.Light/src/core/Index/InvertedDocConsumer.cs
+../../../external/Lucene.Net.Light/src/core/Index/InvertedDocConsumerPerField.cs
+../../../external/Lucene.Net.Light/src/core/Index/InvertedDocConsumerPerThread.cs
+../../../external/Lucene.Net.Light/src/core/Index/InvertedDocEndConsumer.cs
+../../../external/Lucene.Net.Light/src/core/Index/InvertedDocEndConsumerPerField.cs
+../../../external/Lucene.Net.Light/src/core/Index/InvertedDocEndConsumerPerThread.cs
+../../../external/Lucene.Net.Light/src/core/Index/KeepOnlyLastCommitDeletionPolicy.cs
+../../../external/Lucene.Net.Light/src/core/Index/LogByteSizeMergePolicy.cs
+../../../external/Lucene.Net.Light/src/core/Index/LogDocMergePolicy.cs
+../../../external/Lucene.Net.Light/src/core/Index/LogMergePolicy.cs
+../../../external/Lucene.Net.Light/src/core/Index/MergeDocIDRemapper.cs
+../../../external/Lucene.Net.Light/src/core/Index/MergePolicy.cs
+../../../external/Lucene.Net.Light/src/core/Index/MergeScheduler.cs
+../../../external/Lucene.Net.Light/src/core/Index/MultiLevelSkipListReader.cs
+../../../external/Lucene.Net.Light/src/core/Index/MultiLevelSkipListWriter.cs
+../../../external/Lucene.Net.Light/src/core/Index/MultipleTermPositions.cs
+../../../external/Lucene.Net.Light/src/core/Index/MultiReader.cs
+../../../external/Lucene.Net.Light/src/core/Index/NormsWriter.cs
+../../../external/Lucene.Net.Light/src/core/Index/NormsWriterPerField.cs
+../../../external/Lucene.Net.Light/src/core/Index/NormsWriterPerThread.cs
+../../../external/Lucene.Net.Light/src/core/Index/ParallelReader.cs
+../../../external/Lucene.Net.Light/src/core/Index/Payload.cs
+../../../external/Lucene.Net.Light/src/core/Index/PositionBasedTermVectorMapper.cs
+../../../external/Lucene.Net.Light/src/core/Index/RawPostingList.cs
+../../../external/Lucene.Net.Light/src/core/Index/ReadOnlyDirectoryReader.cs
+../../../external/Lucene.Net.Light/src/core/Index/ReadOnlySegmentReader.cs
+../../../external/Lucene.Net.Light/src/core/Index/ReusableStringReader.cs
+../../../external/Lucene.Net.Light/src/core/Index/SegmentInfo.cs
+../../../external/Lucene.Net.Light/src/core/Index/SegmentInfos.cs
+../../../external/Lucene.Net.Light/src/core/Index/SegmentMergeInfo.cs
+../../../external/Lucene.Net.Light/src/core/Index/SegmentMergeQueue.cs
+../../../external/Lucene.Net.Light/src/core/Index/SegmentMerger.cs
+../../../external/Lucene.Net.Light/src/core/Index/SegmentReader.cs
+../../../external/Lucene.Net.Light/src/core/Index/SegmentTermDocs.cs
+../../../external/Lucene.Net.Light/src/core/Index/SegmentTermEnum.cs
+../../../external/Lucene.Net.Light/src/core/Index/SegmentTermPositions.cs
+../../../external/Lucene.Net.Light/src/core/Index/SegmentTermPositionVector.cs
+../../../external/Lucene.Net.Light/src/core/Index/SegmentTermVector.cs
+../../../external/Lucene.Net.Light/src/core/Index/SegmentWriteState.cs
+../../../external/Lucene.Net.Light/src/core/Index/SerialMergeScheduler.cs
+../../../external/Lucene.Net.Light/src/core/Index/SnapshotDeletionPolicy.cs
+../../../external/Lucene.Net.Light/src/core/Index/SortedTermVectorMapper.cs
+../../../external/Lucene.Net.Light/src/core/Index/StaleReaderException.cs
+../../../external/Lucene.Net.Light/src/core/Index/StoredFieldsWriter.cs
+../../../external/Lucene.Net.Light/src/core/Index/StoredFieldsWriterPerThread.cs
+../../../external/Lucene.Net.Light/src/core/Index/Term.cs
+../../../external/Lucene.Net.Light/src/core/Index/TermBuffer.cs
+../../../external/Lucene.Net.Light/src/core/Index/TermDocs.cs
+../../../external/Lucene.Net.Light/src/core/Index/TermEnum.cs
+../../../external/Lucene.Net.Light/src/core/Index/TermFreqVector.cs
+../../../external/Lucene.Net.Light/src/core/Index/TermInfo.cs
+../../../external/Lucene.Net.Light/src/core/Index/TermInfosReader.cs
+../../../external/Lucene.Net.Light/src/core/Index/TermInfosWriter.cs
+../../../external/Lucene.Net.Light/src/core/Index/TermPositions.cs
+../../../external/Lucene.Net.Light/src/core/Index/TermPositionVector.cs
+../../../external/Lucene.Net.Light/src/core/Index/TermsHash.cs
+../../../external/Lucene.Net.Light/src/core/Index/TermsHashConsumer.cs
+../../../external/Lucene.Net.Light/src/core/Index/TermsHashConsumerPerField.cs
+../../../external/Lucene.Net.Light/src/core/Index/TermsHashConsumerPerThread.cs
+../../../external/Lucene.Net.Light/src/core/Index/TermsHashPerField.cs
+../../../external/Lucene.Net.Light/src/core/Index/TermsHashPerThread.cs
+../../../external/Lucene.Net.Light/src/core/Index/TermVectorEntry.cs
+../../../external/Lucene.Net.Light/src/core/Index/TermVectorEntryFreqSortedComparator.cs
+../../../external/Lucene.Net.Light/src/core/Index/TermVectorMapper.cs
+../../../external/Lucene.Net.Light/src/core/Index/TermVectorOffsetInfo.cs
+../../../external/Lucene.Net.Light/src/core/Index/TermVectorsReader.cs
+../../../external/Lucene.Net.Light/src/core/Index/TermVectorsTermsWriter.cs
+../../../external/Lucene.Net.Light/src/core/Index/TermVectorsTermsWriterPerField.cs
+../../../external/Lucene.Net.Light/src/core/Index/TermVectorsTermsWriterPerThread.cs
+../../../external/Lucene.Net.Light/src/core/Index/TermVectorsWriter.cs
+../../../external/Lucene.Net.Light/src/core/LucenePackage.cs
+../../../external/Lucene.Net.Light/src/core/LZOCompressor.cs
+../../../external/Lucene.Net.Light/src/core/Messages/INLSException.cs
+../../../external/Lucene.Net.Light/src/core/Messages/Message.cs
+../../../external/Lucene.Net.Light/src/core/Messages/MessageImpl.cs
+../../../external/Lucene.Net.Light/src/core/Messages/NLS.cs
+../../../external/Lucene.Net.Light/src/core/QueryParser/CharStream.cs
+../../../external/Lucene.Net.Light/src/core/QueryParser/FastCharStream.cs
+../../../external/Lucene.Net.Light/src/core/QueryParser/MultiFieldQueryParser.cs
+../../../external/Lucene.Net.Light/src/core/QueryParser/ParseException.cs
+../../../external/Lucene.Net.Light/src/core/QueryParser/QueryParser.cs
+../../../external/Lucene.Net.Light/src/core/QueryParser/QueryParserConstants.cs
+../../../external/Lucene.Net.Light/src/core/QueryParser/QueryParserTokenManager.cs
+../../../external/Lucene.Net.Light/src/core/QueryParser/Token.cs
+../../../external/Lucene.Net.Light/src/core/QueryParser/TokenMgrError.cs
+../../../external/Lucene.Net.Light/src/core/Search/BooleanClause.cs
+../../../external/Lucene.Net.Light/src/core/Search/BooleanQuery.cs
+../../../external/Lucene.Net.Light/src/core/Search/BooleanScorer.cs
+../../../external/Lucene.Net.Light/src/core/Search/BooleanScorer2.cs
+../../../external/Lucene.Net.Light/src/core/Search/CachingSpanFilter.cs
+../../../external/Lucene.Net.Light/src/core/Search/CachingWrapperFilter.cs
+../../../external/Lucene.Net.Light/src/core/Search/Collector.cs
+../../../external/Lucene.Net.Light/src/core/Search/ComplexExplanation.cs
+../../../external/Lucene.Net.Light/src/core/Search/ConjunctionScorer.cs
+../../../external/Lucene.Net.Light/src/core/Search/ConstantScoreQuery.cs
+../../../external/Lucene.Net.Light/src/core/Search/DefaultSimilarity.cs
+../../../external/Lucene.Net.Light/src/core/Search/DisjunctionMaxQuery.cs
+../../../external/Lucene.Net.Light/src/core/Search/DisjunctionMaxScorer.cs
+../../../external/Lucene.Net.Light/src/core/Search/DisjunctionSumScorer.cs
+../../../external/Lucene.Net.Light/src/core/Search/DocIdSet.cs
+../../../external/Lucene.Net.Light/src/core/Search/DocIdSetIterator.cs
+../../../external/Lucene.Net.Light/src/core/Search/ExactPhraseScorer.cs
+../../../external/Lucene.Net.Light/src/core/Search/Explanation.cs
+../../../external/Lucene.Net.Light/src/core/Search/FieldCache.cs
+../../../external/Lucene.Net.Light/src/core/Search/FieldCacheImpl.cs
+../../../external/Lucene.Net.Light/src/core/Search/FieldCacheRangeFilter.cs
+../../../external/Lucene.Net.Light/src/core/Search/FieldCacheTermsFilter.cs
+../../../external/Lucene.Net.Light/src/core/Search/FieldComparator.cs
+../../../external/Lucene.Net.Light/src/core/Search/FieldComparatorSource.cs
+../../../external/Lucene.Net.Light/src/core/Search/FieldDoc.cs
+../../../external/Lucene.Net.Light/src/core/Search/FieldDocSortedHitQueue.cs
+../../../external/Lucene.Net.Light/src/core/Search/FieldValueHitQueue.cs
+../../../external/Lucene.Net.Light/src/core/Search/Filter.cs
+../../../external/Lucene.Net.Light/src/core/Search/FilteredDocIdSet.cs
+../../../external/Lucene.Net.Light/src/core/Search/FilteredDocIdSetIterator.cs
+../../../external/Lucene.Net.Light/src/core/Search/FilteredQuery.cs
+../../../external/Lucene.Net.Light/src/core/Search/FilteredTermEnum.cs
+../../../external/Lucene.Net.Light/src/core/Search/FilterManager.cs
+../../../external/Lucene.Net.Light/src/core/Search/Function/ByteFieldSource.cs
+../../../external/Lucene.Net.Light/src/core/Search/Function/CustomScoreProvider.cs
+../../../external/Lucene.Net.Light/src/core/Search/Function/CustomScoreQuery.cs
+../../../external/Lucene.Net.Light/src/core/Search/Function/DocValues.cs
+../../../external/Lucene.Net.Light/src/core/Search/Function/FieldCacheSource.cs
+../../../external/Lucene.Net.Light/src/core/Search/Function/FieldScoreQuery.cs
+../../../external/Lucene.Net.Light/src/core/Search/Function/FloatFieldSource.cs
+../../../external/Lucene.Net.Light/src/core/Search/Function/IntFieldSource.cs
+../../../external/Lucene.Net.Light/src/core/Search/Function/OrdFieldSource.cs
+../../../external/Lucene.Net.Light/src/core/Search/Function/ReverseOrdFieldSource.cs
+../../../external/Lucene.Net.Light/src/core/Search/Function/ShortFieldSource.cs
+../../../external/Lucene.Net.Light/src/core/Search/Function/ValueSource.cs
+../../../external/Lucene.Net.Light/src/core/Search/Function/ValueSourceQuery.cs
+../../../external/Lucene.Net.Light/src/core/Search/FuzzyQuery.cs
+../../../external/Lucene.Net.Light/src/core/Search/FuzzyTermEnum.cs
+../../../external/Lucene.Net.Light/src/core/Search/HitQueue.cs
+../../../external/Lucene.Net.Light/src/core/Search/IndexSearcher.cs
+../../../external/Lucene.Net.Light/src/core/Search/MatchAllDocsQuery.cs
+../../../external/Lucene.Net.Light/src/core/Search/MultiPhraseQuery.cs
+../../../external/Lucene.Net.Light/src/core/Search/MultiSearcher.cs
+../../../external/Lucene.Net.Light/src/core/Search/MultiTermQuery.cs
+../../../external/Lucene.Net.Light/src/core/Search/MultiTermQueryWrapperFilter.cs
+../../../external/Lucene.Net.Light/src/core/Search/NumericRangeFilter.cs
+../../../external/Lucene.Net.Light/src/core/Search/NumericRangeQuery.cs
+../../../external/Lucene.Net.Light/src/core/Search/ParallelMultiSearcher.cs
+../../../external/Lucene.Net.Light/src/core/Search/Payloads/AveragePayloadFunction.cs
+../../../external/Lucene.Net.Light/src/core/Search/Payloads/MaxPayloadFunction.cs
+../../../external/Lucene.Net.Light/src/core/Search/Payloads/MinPayloadFunction.cs
+../../../external/Lucene.Net.Light/src/core/Search/Payloads/PayloadFunction.cs
+../../../external/Lucene.Net.Light/src/core/Search/Payloads/PayloadNearQuery.cs
+../../../external/Lucene.Net.Light/src/core/Search/Payloads/PayloadSpanUtil.cs
+../../../external/Lucene.Net.Light/src/core/Search/Payloads/PayloadTermQuery.cs
+../../../external/Lucene.Net.Light/src/core/Search/PhrasePositions.cs
+../../../external/Lucene.Net.Light/src/core/Search/PhraseQuery.cs
+../../../external/Lucene.Net.Light/src/core/Search/PhraseQueue.cs
+../../../external/Lucene.Net.Light/src/core/Search/PhraseScorer.cs
+../../../external/Lucene.Net.Light/src/core/Search/PositiveScoresOnlyCollector.cs
+../../../external/Lucene.Net.Light/src/core/Search/PrefixFilter.cs
+../../../external/Lucene.Net.Light/src/core/Search/PrefixQuery.cs
+../../../external/Lucene.Net.Light/src/core/Search/PrefixTermEnum.cs
+../../../external/Lucene.Net.Light/src/core/Search/Query.cs
+../../../external/Lucene.Net.Light/src/core/Search/QueryTermVector.cs
+../../../external/Lucene.Net.Light/src/core/Search/QueryWrapperFilter.cs
+../../../external/Lucene.Net.Light/src/core/Search/ReqExclScorer.cs
+../../../external/Lucene.Net.Light/src/core/Search/ReqOptSumScorer.cs
+../../../external/Lucene.Net.Light/src/core/Search/ScoreCachingWrappingScorer.cs
+../../../external/Lucene.Net.Light/src/core/Search/ScoreDoc.cs
+../../../external/Lucene.Net.Light/src/core/Search/Scorer.cs
+../../../external/Lucene.Net.Light/src/core/Search/Searchable.cs
+../../../external/Lucene.Net.Light/src/core/Search/Searcher.cs
+../../../external/Lucene.Net.Light/src/core/Search/Similarity.cs
+../../../external/Lucene.Net.Light/src/core/Search/SimilarityDelegator.cs
+../../../external/Lucene.Net.Light/src/core/Search/SingleTermEnum.cs
+../../../external/Lucene.Net.Light/src/core/Search/SloppyPhraseScorer.cs
+../../../external/Lucene.Net.Light/src/core/Search/Sort.cs
+../../../external/Lucene.Net.Light/src/core/Search/SortField.cs
+../../../external/Lucene.Net.Light/src/core/Search/SpanFilter.cs
+../../../external/Lucene.Net.Light/src/core/Search/SpanFilterResult.cs
+../../../external/Lucene.Net.Light/src/core/Search/SpanQueryFilter.cs
+../../../external/Lucene.Net.Light/src/core/Search/Spans/FieldMaskingSpanQuery.cs
+../../../external/Lucene.Net.Light/src/core/Search/Spans/NearSpansOrdered.cs
+../../../external/Lucene.Net.Light/src/core/Search/Spans/NearSpansUnordered.cs
+../../../external/Lucene.Net.Light/src/core/Search/Spans/SpanFirstQuery.cs
+../../../external/Lucene.Net.Light/src/core/Search/Spans/SpanNearQuery.cs
+../../../external/Lucene.Net.Light/src/core/Search/Spans/SpanNotQuery.cs
+../../../external/Lucene.Net.Light/src/core/Search/Spans/SpanOrQuery.cs
+../../../external/Lucene.Net.Light/src/core/Search/Spans/SpanQuery.cs
+../../../external/Lucene.Net.Light/src/core/Search/Spans/Spans.cs
+../../../external/Lucene.Net.Light/src/core/Search/Spans/SpanScorer.cs
+../../../external/Lucene.Net.Light/src/core/Search/Spans/SpanTermQuery.cs
+../../../external/Lucene.Net.Light/src/core/Search/Spans/SpanWeight.cs
+../../../external/Lucene.Net.Light/src/core/Search/Spans/TermSpans.cs
+../../../external/Lucene.Net.Light/src/core/Search/TermQuery.cs
+../../../external/Lucene.Net.Light/src/core/Search/TermRangeFilter.cs
+../../../external/Lucene.Net.Light/src/core/Search/TermRangeQuery.cs
+../../../external/Lucene.Net.Light/src/core/Search/TermRangeTermEnum.cs
+../../../external/Lucene.Net.Light/src/core/Search/TermScorer.cs
+../../../external/Lucene.Net.Light/src/core/Search/TimeLimitingCollector.cs
+../../../external/Lucene.Net.Light/src/core/Search/TopDocs.cs
+../../../external/Lucene.Net.Light/src/core/Search/TopDocsCollector.cs
+../../../external/Lucene.Net.Light/src/core/Search/TopFieldCollector.cs
+../../../external/Lucene.Net.Light/src/core/Search/TopFieldDocs.cs
+../../../external/Lucene.Net.Light/src/core/Search/TopScoreDocCollector.cs
+../../../external/Lucene.Net.Light/src/core/Search/Weight.cs
+../../../external/Lucene.Net.Light/src/core/Search/WildcardQuery.cs
+../../../external/Lucene.Net.Light/src/core/Search/WildcardTermEnum.cs
+../../../external/Lucene.Net.Light/src/core/Store/AlreadyClosedException.cs
+../../../external/Lucene.Net.Light/src/core/Store/BufferedIndexInput.cs
+../../../external/Lucene.Net.Light/src/core/Store/BufferedIndexOutput.cs
+../../../external/Lucene.Net.Light/src/core/Store/CheckSumIndexInput.cs
+../../../external/Lucene.Net.Light/src/core/Store/CheckSumIndexOutput.cs
+../../../external/Lucene.Net.Light/src/core/Store/Directory.cs
+../../../external/Lucene.Net.Light/src/core/Store/FileSwitchDirectory.cs
+../../../external/Lucene.Net.Light/src/core/Store/FSDirectory.cs
+../../../external/Lucene.Net.Light/src/core/Store/FSLockFactory.cs
+../../../external/Lucene.Net.Light/src/core/Store/IndexInput.cs
+../../../external/Lucene.Net.Light/src/core/Store/IndexOutput.cs
+../../../external/Lucene.Net.Light/src/core/Store/Lock.cs
+../../../external/Lucene.Net.Light/src/core/Store/LockFactory.cs
+../../../external/Lucene.Net.Light/src/core/Store/LockObtainFailedException.cs
+../../../external/Lucene.Net.Light/src/core/Store/LockReleaseFailedException.cs
+../../../external/Lucene.Net.Light/src/core/Store/LockStressTest.cs
+../../../external/Lucene.Net.Light/src/core/Store/LockVerifyServer.cs
+../../../external/Lucene.Net.Light/src/core/Store/MMapDirectory.cs
+../../../external/Lucene.Net.Light/src/core/Store/NativeFSLockFactory.cs
+../../../external/Lucene.Net.Light/src/core/Store/NIOFSDirectory.cs
+../../../external/Lucene.Net.Light/src/core/Store/NoLockFactory.cs
+../../../external/Lucene.Net.Light/src/core/Store/NoSuchDirectoryException.cs
+../../../external/Lucene.Net.Light/src/core/Store/RAMDirectory.cs
+../../../external/Lucene.Net.Light/src/core/Store/RAMFile.cs
+../../../external/Lucene.Net.Light/src/core/Store/RAMInputStream.cs
+../../../external/Lucene.Net.Light/src/core/Store/RAMOutputStream.cs
+../../../external/Lucene.Net.Light/src/core/Store/SimpleFSDirectory.cs
+../../../external/Lucene.Net.Light/src/core/Store/SimpleFSLockFactory.cs
+../../../external/Lucene.Net.Light/src/core/Store/SingleInstanceLockFactory.cs
+../../../external/Lucene.Net.Light/src/core/Store/VerifyingLockFactory.cs
+../../../external/Lucene.Net.Light/src/core/Support/AppSettings.cs
+../../../external/Lucene.Net.Light/src/core/Support/AttributeImplItem.cs
+../../../external/Lucene.Net.Light/src/core/Support/BitSetSupport.cs
+../../../external/Lucene.Net.Light/src/core/Support/BuildType.cs
+../../../external/Lucene.Net.Light/src/core/Support/Character.cs
+../../../external/Lucene.Net.Light/src/core/Support/CloseableThreadLocalProfiler.cs
+../../../external/Lucene.Net.Light/src/core/Support/CollectionsHelper.cs
+../../../external/Lucene.Net.Light/src/core/Support/Compare.cs
+../../../external/Lucene.Net.Light/src/core/Support/Compatibility/ConcurrentDictionary.cs
+../../../external/Lucene.Net.Light/src/core/Support/Compatibility/Func.cs
+../../../external/Lucene.Net.Light/src/core/Support/Compatibility/ISet.cs
+../../../external/Lucene.Net.Light/src/core/Support/Compatibility/SetFactory.cs
+../../../external/Lucene.Net.Light/src/core/Support/Compatibility/SortedSet.cs
+../../../external/Lucene.Net.Light/src/core/Support/Compatibility/ThreadLocal.cs
+../../../external/Lucene.Net.Light/src/core/Support/Compatibility/WrappedHashSet.cs
+../../../external/Lucene.Net.Light/src/core/Support/CRC32.cs
+../../../external/Lucene.Net.Light/src/core/Support/Cryptography.cs
+../../../external/Lucene.Net.Light/src/core/Support/Deflater.cs
+../../../external/Lucene.Net.Light/src/core/Support/Double.cs
+../../../external/Lucene.Net.Light/src/core/Support/EquatableList.cs
+../../../external/Lucene.Net.Light/src/core/Support/FileSupport.cs
+../../../external/Lucene.Net.Light/src/core/Support/GeneralKeyedCollection.cs
+../../../external/Lucene.Net.Light/src/core/Support/HashMap.cs
+../../../external/Lucene.Net.Light/src/core/Support/IChecksum.cs
+../../../external/Lucene.Net.Light/src/core/Support/Inflater.cs
+../../../external/Lucene.Net.Light/src/core/Support/IThreadRunnable.cs
+../../../external/Lucene.Net.Light/src/core/Support/Number.cs
+../../../external/Lucene.Net.Light/src/core/Support/OS.cs
+../../../external/Lucene.Net.Light/src/core/Support/SharpZipLib.cs
+../../../external/Lucene.Net.Light/src/core/Support/Single.cs
+../../../external/Lucene.Net.Light/src/core/Support/TextSupport.cs
+../../../external/Lucene.Net.Light/src/core/Support/ThreadClass.cs
+../../../external/Lucene.Net.Light/src/core/Support/ThreadLock.cs
+../../../external/Lucene.Net.Light/src/core/Support/WeakDictionary.cs
+../../../external/Lucene.Net.Light/src/core/Util/ArrayUtil.cs
+../../../external/Lucene.Net.Light/src/core/Util/Attribute.cs
+../../../external/Lucene.Net.Light/src/core/Util/AttributeSource.cs
+../../../external/Lucene.Net.Light/src/core/Util/AverageGuessMemoryModel.cs
+../../../external/Lucene.Net.Light/src/core/Util/BitUtil.cs
+../../../external/Lucene.Net.Light/src/core/Util/BitVector.cs
+../../../external/Lucene.Net.Light/src/core/Util/Cache/Cache.cs
+../../../external/Lucene.Net.Light/src/core/Util/Cache/SimpleLRUCache.cs
+../../../external/Lucene.Net.Light/src/core/Util/Cache/SimpleMapCache.cs
+../../../external/Lucene.Net.Light/src/core/Util/CloseableThreadLocal.cs
+../../../external/Lucene.Net.Light/src/core/Util/Constants.cs
+../../../external/Lucene.Net.Light/src/core/Util/DocIdBitSet.cs
+../../../external/Lucene.Net.Light/src/core/Util/FieldCacheSanityChecker.cs
+../../../external/Lucene.Net.Light/src/core/Util/IAttribute.cs
+../../../external/Lucene.Net.Light/src/core/Util/IdentityDictionary.cs
+../../../external/Lucene.Net.Light/src/core/Util/IndexableBinaryStringTools.cs
+../../../external/Lucene.Net.Light/src/core/Util/MapOfSets.cs
+../../../external/Lucene.Net.Light/src/core/Util/MemoryModel.cs
+../../../external/Lucene.Net.Light/src/core/Util/NumericUtils.cs
+../../../external/Lucene.Net.Light/src/core/Util/OpenBitSet.cs
+../../../external/Lucene.Net.Light/src/core/Util/OpenBitSetDISI.cs
+../../../external/Lucene.Net.Light/src/core/Util/OpenBitSetIterator.cs
+../../../external/Lucene.Net.Light/src/core/Util/PriorityQueue.cs
+../../../external/Lucene.Net.Light/src/core/Util/RamUsageEstimator.cs
+../../../external/Lucene.Net.Light/src/core/Util/ReaderUtil.cs
+../../../external/Lucene.Net.Light/src/core/Util/ScorerDocQueue.cs
+../../../external/Lucene.Net.Light/src/core/Util/SimpleStringInterner.cs
+../../../external/Lucene.Net.Light/src/core/Util/SmallFloat.cs
+../../../external/Lucene.Net.Light/src/core/Util/SortedVIntList.cs
+../../../external/Lucene.Net.Light/src/core/Util/SorterTemplate.cs
+../../../external/Lucene.Net.Light/src/core/Util/StringHelper.cs
+../../../external/Lucene.Net.Light/src/core/Util/StringInterner.cs
+../../../external/Lucene.Net.Light/src/core/Util/ToStringUtils.cs
+../../../external/Lucene.Net.Light/src/core/Util/UnicodeUtil.cs
+../../../external/Lucene.Net.Light/src/core/Util/Version.cs
diff --git a/mcs/errors/CS0122-38-lib.cs b/mcs/errors/CS0122-38-lib.cs
new file mode 100644 (file)
index 0000000..bcedb91
--- /dev/null
@@ -0,0 +1,8 @@
+using System.Runtime.CompilerServices;
+
+[assembly: InternalsVisibleTo("cs0122-38, PublicKeyToken=<ad60da1470a03d36")]
+
+class Internal
+{
+       
+}
\ No newline at end of file
index d19d3c469309d65daf71f9e4ab7bd9b3aa60f021..ac117f61d8d5f54b088fcdc38128d01fbe720b3b 100644 (file)
@@ -22,7 +22,7 @@ DISTFILES = \
 
 TEST_SUPPORT_FILES = \
        CS0012-lib.dll CS0012-2-lib.dll CS0012-3-lib.dll CS0012-4-lib.dll CS0012-5-lib.dll CS0012-6-lib.dll CS0012-9-lib.dll CS0012-10-lib.dll CS0012-11-lib.dll CS0012-12-lib.dll CS0012-13-lib.dll CS0012-14-lib.dll CS0012-15-lib.dll CS0012-16-lib.dll CS0012-17-lib.dll CS0012-18-lib.dll CS0012-21-lib.dll CS0012-22-lib.dll CS0012-23-lib.dll CS0012-24-lib.dll CS0019-71-lib.dll CS0029-26-lib.dll \
-       CS0103-2-lib.dll CS0118-2-lib.dll CS0122-8-lib.dll CS0122-10-lib.dll CS0122-14-lib.dll CS0122-15-lib.dll CS0122-19-lib.dll CS0122-35-lib.dll CS0122-36-lib.dll CS0143-lib.dll CS0144-3-lib.dll CS0165-19-lib.dll CS0165-51-lib.dll \
+       CS0103-2-lib.dll CS0118-2-lib.dll CS0122-8-lib.dll CS0122-10-lib.dll CS0122-14-lib.dll CS0122-15-lib.dll CS0122-19-lib.dll CS0122-35-lib.dll CS0122-36-lib.dll CS0122-38-lib.dll CS0143-lib.dll CS0144-3-lib.dll CS0165-19-lib.dll CS0165-51-lib.dll \
        CS0205-3-lib.dll CS0246-29-lib.dll CS0229-3-lib.dll CS0229-4-lib.dll CS0266-25-lib.dll \
        CS0315-2-lib.dll \
        CS0425-7-lib.dll CS0433-lib.dll CS0433-2-lib.dll \
diff --git a/mcs/errors/cs0122-38.cs b/mcs/errors/cs0122-38.cs
new file mode 100644 (file)
index 0000000..e309750
--- /dev/null
@@ -0,0 +1,11 @@
+// CS0122: `Internal' is inaccessible due to its protection level
+// Line: 9
+// Compiler options: -r:CS0122-38-lib.dll
+
+class M
+{
+       public static void Main ()
+       {
+               new Internal ();
+       }
+}
\ No newline at end of file
diff --git a/mcs/errors/cs9030-2.cs b/mcs/errors/cs9030-2.cs
new file mode 100644 (file)
index 0000000..c7d6fcc
--- /dev/null
@@ -0,0 +1,17 @@
+// CS9030: The left-hand side of an assignment cannot contain a null propagating operator
+// Line: 15
+
+public class Test1
+{
+       public class Test2
+       {
+               public System.EventHandler<System.EventArgs> E;
+       }
+
+       public Test2 test2 = new Test2 ();
+
+       static void Main ()
+       {
+               new Test1 ()?.test2.E += null;
+       }
+}
index 2073041afa252248e1f856efef43e9b91afaa1d4..56fb8d6d43cf8f7f936f162408d63f139d06c034 100644 (file)
 using System;
 
 #if STATIC
+using SecurityType = System.Collections.Generic.List<IKVM.Reflection.Emit.CustomAttributeBuilder>;
 using IKVM.Reflection;
 using IKVM.Reflection.Emit;
 #else
+using SecurityType = System.Collections.Generic.Dictionary<System.Security.Permissions.SecurityAction, System.Security.PermissionSet>;
 using System.Reflection;
 using System.Reflection.Emit;
 #endif
@@ -45,6 +47,8 @@ namespace Mono.CSharp {
                Expression instance_expr;
                ReturnParameter return_attributes;
 
+               SecurityType declarative_security;
+
                const Modifiers MethodModifiers = Modifiers.PUBLIC | Modifiers.VIRTUAL;
 
                const Modifiers AllowedModifiers =
@@ -104,6 +108,11 @@ namespace Mono.CSharp {
                                return;
                        }
 
+                       if (a.IsValidSecurityAttribute ()) {
+                               a.ExtractSecurityPermissionSet (ctor, ref declarative_security);
+                               return;
+                       }
+
                        base.ApplyAttributeBuilder (a, ctor, cdata, pa);
                }
 
@@ -308,6 +317,16 @@ namespace Mono.CSharp {
                {
                        base.Emit ();
 
+                       if (declarative_security != null) {
+                               foreach (var de in declarative_security) {
+#if STATIC
+                                       TypeBuilder.__AddDeclarativeSecurity (de);
+#else
+                                       TypeBuilder.AddDeclarativeSecurity (de.Key, de.Value);
+#endif
+                               }
+                       }
+
                        if (ReturnType.Type != null) {
                                if (ReturnType.Type.BuiltinType == BuiltinTypeSpec.Type.Dynamic) {
                                        return_attributes = new ReturnParameter (this, InvokeBuilder.MethodBuilder, Location);
index f1723d2352a868dbdc1e6f016fa884b9516d67c7..74501e89b1503db64ab68fca1a7a884ba1632867 100644 (file)
@@ -6385,7 +6385,7 @@ namespace Mono.CSharp {
 
                public override Expression DoResolveLValue (ResolveContext ec, Expression right_side)
                {
-                       if (ConditionalAccess)
+                       if (HasConditionalAccess ())
                                Error_NullPropagatingLValue (ec);
 
                        if (spec is FixedFieldSpec) {
@@ -7144,7 +7144,7 @@ namespace Mono.CSharp {
 
                public override Expression DoResolveLValue (ResolveContext rc, Expression right_side)
                {
-                       if (ConditionalAccess)
+                       if (HasConditionalAccess ())
                                Error_NullPropagatingLValue (rc);
 
                        if (right_side == EmptyExpression.OutAccess) {
@@ -7390,7 +7390,7 @@ namespace Mono.CSharp {
                                return null;
                        }
 
-                       if (ConditionalAccess)
+                       if (HasConditionalAccess ())
                                Error_NullPropagatingLValue (ec);
 
                        op = CandidateToBaseOverride (ec, op);
index 998b2f2afaf104b500022c67732fe08f1464e0a2..5f6c0633727978265700c2e19e9e9df2f82b839e 100644 (file)
@@ -10374,7 +10374,7 @@ namespace Mono.CSharp
 
                public override Expression DoResolveLValue (ResolveContext ec, Expression right_side)
                {
-                       if (ConditionalAccess)
+                       if (HasConditionalAccess ())
                                Error_NullPropagatingLValue (ec);
 
                        return DoResolve (ec);
index 630548ce8d28a7665d7f15a4a23e2820e0eaa862..42401de7ad90eec78a821ed1f23893d395529b19 100644 (file)
@@ -13,6 +13,7 @@ using System;
 using System.Runtime.CompilerServices;
 using System.Linq;
 using System.Collections.Generic;
+using System.IO;
 
 #if STATIC
 using MetaType = IKVM.Reflection.Type;
@@ -1724,7 +1725,14 @@ namespace Mono.CSharp
                                        if (s == null)
                                                continue;
 
-                                       var an = new AssemblyName (s);
+                                       AssemblyName an;
+                                       try {
+                                               an = new AssemblyName (s);
+                                       } catch (FileLoadException) {
+                                               // Invalid assembly name reuses FileLoadException
+                                               continue;
+                                       }
+
                                        if (internals_visible_to == null)
                                                internals_visible_to = new List<AssemblyName> ();
 
index 7d95e44efdb433bcd01ea8229d9b719af3b86099..4b7b21e4887bfb9c5627b494cfbb489e03dededd 100644 (file)
@@ -246,7 +246,7 @@ namespace Mono.CSharp
                        protected override void ApplyToExtraTarget (Attribute a, MethodSpec ctor, byte[] cdata, PredefinedAttributes pa)
                        {
                                if (a.Target == AttributeTargets.Parameter) {
-                                       parameters[0].ApplyAttributeBuilder (a, ctor, cdata, pa);
+                                       parameters[parameters.Count - 1].ApplyAttributeBuilder (a, ctor, cdata, pa);
                                        return;
                                }
 
diff --git a/mcs/tests/dtest-061.cs b/mcs/tests/dtest-061.cs
new file mode 100644 (file)
index 0000000..de16049
--- /dev/null
@@ -0,0 +1,63 @@
+using System;
+
+namespace Test
+{
+       public class Program
+       {
+               static int[] testValues = {0, -1, 200, -200, 32, -32, 64, -128, 333, 5};
+
+               dynamic dynBase;
+               dynamic dynAmt;
+
+               int? optBase;
+               int? optAmt;
+
+               int normBase;
+               int normAmt;
+
+               dynamic uDynBase;
+
+               public static void Main ()
+               {
+                       var tester = new Program ();
+
+                       foreach (int baseVal in testValues)
+                               foreach (int amt in testValues)
+                                       tester.ShiftTest (baseVal, amt);
+               }
+
+               public static void AreEqual<A, B> (A a, B b)
+               {
+                       if (!a.Equals (b))
+                               throw new Exception (
+                                       String.Format (
+                                               "Shift Equality Assertion Failed: Had {0} and expected {1}", a, b));
+               }
+
+               public void ShiftTest (int shiftBase, int shiftAmt)
+               {
+                       optBase = dynBase = normBase = shiftBase;
+                       optAmt = dynAmt = normAmt = shiftAmt;
+                       int immediate = shiftBase << shiftAmt;
+
+                       AreEqual<int?, int?> (dynBase << dynAmt, immediate);
+                       AreEqual<int?, int?> (dynBase << optAmt, immediate);
+                       AreEqual<int?, int?> (dynBase << normAmt, immediate);
+
+                       AreEqual<int?, int?> (optBase << dynAmt, immediate);
+                       AreEqual<int?, int?> (optBase << optAmt, immediate);
+                       AreEqual<int?, int?> (optBase << normAmt, immediate);
+
+                       AreEqual<int?, int?> (normBase << dynAmt, immediate);
+                       AreEqual<int?, int?> (normBase << optAmt, immediate);
+                       AreEqual<int?, int?> (normBase << normAmt, immediate);
+
+                       uint uShiftBase = (uint)shiftBase;
+                       uDynBase = uShiftBase;
+
+                       AreEqual<uint?, uint?> (uShiftBase << dynAmt, uDynBase << dynAmt);
+                       AreEqual<uint?, uint?> (uShiftBase << optAmt, uDynBase << optAmt);
+                       AreEqual<uint?, uint?> (uShiftBase << normAmt, uDynBase << normAmt);
+               }
+       }
+}
index 0cbdf42476262ee74db841ba87e8b812dfcb324e..6503f64e039412317e0144956ed4ebff08ca3efe 100644 (file)
@@ -1,6 +1,9 @@
 using System.Security;
 using System.Security.Permissions;
 
+[HostProtection]
+delegate void D ();
+
 [HostProtection]
 class X
 {
diff --git a/mcs/tests/test-925.cs b/mcs/tests/test-925.cs
new file mode 100644 (file)
index 0000000..5e9ecec
--- /dev/null
@@ -0,0 +1,43 @@
+using System;
+using System.Linq;
+using System.Reflection;
+
+class Program
+{
+       public static int Main ()
+       {
+               var setter = typeof (MyClass).GetMember("set_Item")[0] as MethodInfo;
+               var sp = setter.GetParameters ();
+               var first = sp [0].GetCustomAttributes ();
+               var value = sp [2].GetCustomAttributes ();
+
+               if (first.Count () != 0)
+                       return 1;
+
+               if (value.Count () != 1)
+                       return 2;
+                       
+               return 0;
+       }
+}
+
+[AttributeUsage(AttributeTargets.All)]
+public class MyAttribute2Attribute : Attribute
+{
+}
+
+public class MyClass
+{
+       public string this[int index1, int index2]
+       {
+               get
+               {
+                       return "";
+               }
+
+               [param: MyAttribute2]
+               set
+               {
+               }
+       }
+}
\ No newline at end of file
index 8e0211e5ef763f19a9839b51a88818b728613e08..b306de4869ad986ab7ed4a5324e0f4f171b289a2 100644 (file)
         <size>7</size>
       </method>
     </type>
+    <type name="D">
+      <method name="Void Invoke()" attrs="454">
+        <size>0</size>
+      </method>
+      <method name="System.IAsyncResult BeginInvoke(System.AsyncCallback, System.Object)" attrs="454">
+        <size>0</size>
+      </method>
+      <method name="Void EndInvoke(System.IAsyncResult)" attrs="454">
+        <size>0</size>
+      </method>
+      <method name="Void .ctor(Object, IntPtr)" attrs="6278">
+        <size>0</size>
+      </method>
+    </type>
   </test>
   <test name="test-911.cs">
     <type name="N">
       </method>
     </type>
   </test>
+  <test name="test-925.cs">
+    <type name="Program">
+      <method name="Int32 Main()" attrs="150">
+        <size>104</size>
+      </method>
+      <method name="Void .ctor()" attrs="6278">
+        <size>7</size>
+      </method>
+    </type>
+    <type name="MyAttribute2Attribute">
+      <method name="Void .ctor()" attrs="6278">
+        <size>7</size>
+      </method>
+    </type>
+    <type name="MyClass">
+      <method name="System.String get_Item(Int32, Int32)" attrs="2182">
+        <size>14</size>
+      </method>
+      <method name="Void set_Item(Int32, Int32, System.String)" attrs="2182">
+        <size>2</size>
+      </method>
+      <method name="Void .ctor()" attrs="6278">
+        <size>7</size>
+      </method>
+    </type>
+  </test>
   <test name="test-93.cs">
     <type name="N1.C">
       <method name="Void .ctor()" attrs="6278">
index cdb191f3171efc1ad6582ad4201bd023a61f65ca..a57d8aaeb7ad287a7eebf321b6ddf9e2b5c648ad 100644 (file)
 #endif
 #endif
 
-#if defined(PLATFORM_MACOSX) || defined(__OpenBSD__)
+#if defined(PLATFORM_MACOSX) || defined(__OpenBSD__) || defined(__FreeBSD__)
 #include <sys/proc.h>
 #include <sys/sysctl.h>
 #  if !defined(__OpenBSD__)
 #    include <sys/utsname.h>
 #  endif
+#  if defined(__FreeBSD__)
+#    include <sys/user.h>  /* struct kinfo_proc */
+#  endif
 #endif
 
 #ifdef PLATFORM_SOLARIS
@@ -115,7 +118,7 @@ static guint32 process_wait (gpointer handle, guint32 timeout, gboolean alertabl
 static void process_close (gpointer handle, gpointer data);
 static gboolean is_pid_valid (pid_t pid);
 
-#if !(defined(PLATFORM_MACOSX) || defined(__OpenBSD__) || defined(__HAIKU__))
+#if !(defined(PLATFORM_MACOSX) || defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__HAIKU__))
 static FILE *
 open_process_map (int pid, const char *mode);
 #endif
@@ -175,7 +178,7 @@ is_pid_valid (pid_t pid)
 {
        gboolean result = FALSE;
 
-#if defined(PLATFORM_MACOSX) || defined(__OpenBSD__)
+#if defined(PLATFORM_MACOSX) || defined(__OpenBSD__) || defined(__FreeBSD__)
        if (((kill(pid, 0) == 0) || (errno == EPERM)) && pid != 0)
                result = TRUE;
 #elif defined(__HAIKU__)
@@ -1448,7 +1451,7 @@ static GSList *load_modules (void)
        
        return(ret);
 }
-#elif defined(__OpenBSD__)
+#elif defined(__OpenBSD__) || defined(__FreeBSD__)
 #include <link.h>
 static int load_modules_callback (struct dl_phdr_info *info, size_t size, void *ptr)
 {
@@ -1670,6 +1673,7 @@ static gboolean match_procname_to_modulename (char *procname, char *modulename)
        if (procname == NULL || modulename == NULL)
                return (FALSE);
 
+       DEBUG ("%s: procname=\"%s\", modulename=\"%s\"", __func__, procname, modulename);
        pname = mono_path_resolve_symlinks (procname);
        mname = mono_path_resolve_symlinks (modulename);
 
@@ -1698,10 +1702,11 @@ static gboolean match_procname_to_modulename (char *procname, char *modulename)
        g_free (pname);
        g_free (mname);
 
+       DEBUG ("%s: result is %d", __func__, result);
        return result;
 }
 
-#if !(defined(PLATFORM_MACOSX) || defined(__OpenBSD__) || defined(__HAIKU__))
+#if !(defined(PLATFORM_MACOSX) || defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__HAIKU__))
 static FILE *
 open_process_map (int pid, const char *mode)
 {
@@ -1724,11 +1729,13 @@ open_process_map (int pid, const char *mode)
 }
 #endif
 
+static char *get_process_name_from_proc (pid_t pid);
+
 gboolean EnumProcessModules (gpointer process, gpointer *modules,
                             guint32 size, guint32 *needed)
 {
        WapiHandle_process *process_handle;
-#if !defined(__OpenBSD__) && !defined(PLATFORM_MACOSX)
+#if !defined(__OpenBSD__) && !defined(PLATFORM_MACOSX) && !defined(__FreeBSD__)
        FILE *fp;
 #endif
        GSList *mods = NULL;
@@ -1752,6 +1759,7 @@ gboolean EnumProcessModules (gpointer process, gpointer *modules,
 
        if (WAPI_IS_PSEUDO_PROCESS_HANDLE (process)) {
                pid = WAPI_HANDLE_TO_PID (process);
+               proc_name = get_process_name_from_proc (pid);
        } else {
                process_handle = lookup_process_handle (process);
                if (!process_handle) {
@@ -1763,7 +1771,7 @@ gboolean EnumProcessModules (gpointer process, gpointer *modules,
                proc_name = process_handle->proc_name;
        }
        
-#if defined(PLATFORM_MACOSX) || defined(__OpenBSD__) || defined(__HAIKU__)
+#if defined(PLATFORM_MACOSX) || defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__HAIKU__)
        mods = load_modules ();
        if (!proc_name) {
                modules[0] = NULL;
@@ -1818,7 +1826,7 @@ gboolean EnumProcessModules (gpointer process, gpointer *modules,
 static char *
 get_process_name_from_proc (pid_t pid)
 {
-#if defined(__OpenBSD__)
+#if defined(__OpenBSD__) || defined(__FreeBSD__)
        int mib [6];
        size_t size;
        struct kinfo_proc *pi;
@@ -1876,6 +1884,30 @@ get_process_name_from_proc (pid_t pid)
 
        free(pi);
 #endif
+#elif defined(__FreeBSD__)
+       mib [0] = CTL_KERN;
+       mib [1] = KERN_PROC;
+       mib [2] = KERN_PROC_PID;
+       mib [3] = pid;
+       if (sysctl(mib, 4, NULL, &size, NULL, 0) < 0) {
+               DEBUG ("%s: sysctl() failed: %d", __func__, errno);
+               return(ret);
+       }
+
+       if ((pi = malloc(size)) == NULL)
+               return(ret);
+
+       if (sysctl (mib, 4, pi, &size, NULL, 0) < 0) {
+               if (errno == ENOMEM) {
+                       free(pi);
+                       DEBUG ("%s: Didn't allocate enough memory for kproc info", __func__);
+               }
+               return(ret);
+       }
+
+       if (strlen (pi->ki_comm) > 0)
+               ret = g_strdup (pi->ki_comm);
+       free(pi);
 #elif defined(__OpenBSD__)
        mib [0] = CTL_KERN;
        mib [1] = KERN_PROC;
@@ -1885,8 +1917,10 @@ get_process_name_from_proc (pid_t pid)
        mib [5] = 0;
 
 retry:
-       if (sysctl(mib, 6, NULL, &size, NULL, 0) < 0)
+       if (sysctl(mib, 6, NULL, &size, NULL, 0) < 0) {
+               DEBUG ("%s: sysctl() failed: %d", __func__, errno);
                return(ret);
+       }
 
        if ((pi = malloc(size)) == NULL)
                return(ret);
@@ -1902,8 +1936,13 @@ retry:
                return(ret);
        }
 
+#if defined(__OpenBSD__)
        if (strlen (pi->p_comm) > 0)
                ret = g_strdup (pi->p_comm);
+#elif defined(__FreeBSD__)
+       if (strlen (pi->ki_comm) > 0)
+               ret = g_strdup (pi->ki_comm);
+#endif
 
        free(pi);
 #elif defined(__HAIKU__)
@@ -2010,7 +2049,7 @@ get_module_name (gpointer process, gpointer module,
        char *procname_ext = NULL;
        glong len;
        gsize bytes;
-#if !defined(__OpenBSD__) && !defined(PLATFORM_MACOSX)
+#if !defined(__OpenBSD__) && !defined(PLATFORM_MACOSX) && !defined(__FreeBSD__)
        FILE *fp;
 #endif
        GSList *mods = NULL;
@@ -2044,7 +2083,7 @@ get_module_name (gpointer process, gpointer module,
        }
 
        /* Look up the address in /proc/<pid>/maps */
-#if defined(PLATFORM_MACOSX) || defined(__OpenBSD__) || defined(__HAIKU__)
+#if defined(PLATFORM_MACOSX) || defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__HAIKU__)
        mods = load_modules ();
 #else
        fp = open_process_map (pid, "r");
@@ -2150,7 +2189,7 @@ GetModuleInformation (gpointer process, gpointer module,
 {
        WapiHandle_process *process_handle;
        pid_t pid;
-#if !defined(__OpenBSD__) && !defined(PLATFORM_MACOSX)
+#if !defined(__OpenBSD__) && !defined(PLATFORM_MACOSX) && !defined(__FreeBSD__)
        FILE *fp;
 #endif
        GSList *mods = NULL;
@@ -2181,7 +2220,7 @@ GetModuleInformation (gpointer process, gpointer module,
                proc_name = g_strdup (process_handle->proc_name);
        }
 
-#if defined(PLATFORM_MACOSX) || defined(__OpenBSD__) || defined(__HAIKU__)
+#if defined(PLATFORM_MACOSX) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__HAIKU__)
        mods = load_modules ();
 #else
        /* Look up the address in /proc/<pid>/maps */
index 385dc6a8186c536f6503c1d3532d422d0cd351a8..12c0a762b9099ed31eb9e3d93e848ad3a648e017 100644 (file)
@@ -1062,6 +1062,8 @@ mono_gc_get_managed_allocator (MonoClass *klass, gboolean for_box, gboolean know
                return NULL;
        if (klass->byval_arg.type == MONO_TYPE_STRING) {
                atype = ATYPE_STRING;
+       } else if (!known_instance_size) {
+               return NULL;
        } else if (!klass->has_references) {
                if (for_box)
                        atype = ATYPE_FREEPTR_FOR_BOX;
index 441b0a4271ce2118e96a4cb63c8139a775ab2343..25a116171ab719b34c31dde89c6ba5eb71631269 100644 (file)
@@ -1223,6 +1223,9 @@ mono_loader_get_last_error (void);
 void
 mono_loader_clear_error    (void);
 
+void
+mono_loader_assert_no_error (void);
+
 void
 mono_reflection_init       (void);
 
index ca7567985ff3193344445353b7920d60b46a516c..058c0c982d2879f7061c0a050139350518727c56 100644 (file)
@@ -280,7 +280,7 @@ done:
                        mono_error_set_type_load_name (error, name, assembly, "Could not resolve type with token %08x", type_token);
                }
        }
-       g_assert (!mono_loader_get_last_error ());
+       mono_loader_assert_no_error ();
        return res;
 }
 
@@ -1335,7 +1335,7 @@ mono_class_find_enum_basetype (MonoClass *class, MonoError *error)
        mono_error_set_type_load_class (error, class, "Could not find base type");
 
 fail:
-       g_assert (!mono_loader_get_last_error ());
+       mono_loader_assert_no_error ();
        return NULL;
 }
 
@@ -5744,7 +5744,7 @@ mono_class_create_from_typedef (MonoImage *image, guint32 type_token, MonoError
 
        if (mono_metadata_token_table (type_token) != MONO_TABLE_TYPEDEF || tidx > tt->rows) {
                mono_error_set_bad_image (error, image, "Invalid typedef token %x", type_token);
-               g_assert (!mono_loader_get_last_error ());
+               mono_loader_assert_no_error ();
                return NULL;
        }
 
@@ -5752,7 +5752,7 @@ mono_class_create_from_typedef (MonoImage *image, guint32 type_token, MonoError
 
        if ((class = mono_internal_hash_table_lookup (&image->class_cache, GUINT_TO_POINTER (type_token)))) {
                mono_loader_unlock ();
-               g_assert (!mono_loader_get_last_error ());
+               mono_loader_assert_no_error ();
                return class;
        }
 
@@ -5841,7 +5841,7 @@ mono_class_create_from_typedef (MonoImage *image, guint32 type_token, MonoError
                        mono_class_set_failure (class, MONO_EXCEPTION_TYPE_LOAD, g_strdup (mono_error_get_message (error)));
                        mono_loader_unlock ();
                        mono_profiler_class_loaded (class, MONO_PROFILE_FAILED);
-                       g_assert (!mono_loader_get_last_error ());
+                       mono_loader_assert_no_error ();
                        return NULL;
                }
        }
@@ -5913,7 +5913,7 @@ mono_class_create_from_typedef (MonoImage *image, guint32 type_token, MonoError
                        mono_class_set_failure (class, MONO_EXCEPTION_TYPE_LOAD, g_strdup (mono_error_get_message (error)));
                        mono_loader_unlock ();
                        mono_profiler_class_loaded (class, MONO_PROFILE_FAILED);
-                       g_assert (!mono_loader_get_last_error ());
+                       mono_loader_assert_no_error ();
                        return NULL;
                }
                class->cast_class = class->element_class = mono_class_from_mono_type (enum_basetype);
@@ -5928,7 +5928,7 @@ mono_class_create_from_typedef (MonoImage *image, guint32 type_token, MonoError
                mono_class_set_failure (class, MONO_EXCEPTION_TYPE_LOAD, g_strdup_printf ("Could not load generic parameter constrains due to %s", mono_error_get_message (error)));
                mono_loader_unlock ();
                mono_profiler_class_loaded (class, MONO_PROFILE_FAILED);
-               g_assert (!mono_loader_get_last_error ());
+               mono_loader_assert_no_error ();
                return NULL;
        }
 
@@ -5940,7 +5940,7 @@ mono_class_create_from_typedef (MonoImage *image, guint32 type_token, MonoError
        mono_loader_unlock ();
 
        mono_profiler_class_loaded (class, MONO_PROFILE_OK);
-       g_assert (!mono_loader_get_last_error ());
+       mono_loader_assert_no_error ();
 
        return class;
 
@@ -5948,7 +5948,7 @@ parent_failure:
        mono_class_setup_mono_type (class);
        mono_loader_unlock ();
        mono_profiler_class_loaded (class, MONO_PROFILE_FAILED);
-       g_assert (!mono_loader_get_last_error ());
+       mono_loader_assert_no_error ();
        return NULL;
 }
 
@@ -6546,7 +6546,7 @@ mono_type_retrieve_from_typespec (MonoImage *image, guint32 type_spec, MonoGener
                MonoType *inflated = inflate_generic_type (NULL, t, context, error);
 
                if (!mono_error_ok (error)) {
-                       g_assert (!mono_loader_get_last_error ());
+                       mono_loader_assert_no_error ();
                        return NULL;
                }
 
@@ -7408,7 +7408,7 @@ mono_type_get_checked (MonoImage *image, guint32 type_token, MonoGenericContext
                MonoClass *class = mono_class_get_checked (image, type_token, error);
 
                if (!class) {
-                       g_assert (!mono_loader_get_last_error ());
+                       mono_loader_assert_no_error ();
                        return NULL;
                }
 
@@ -7419,7 +7419,7 @@ mono_type_get_checked (MonoImage *image, guint32 type_token, MonoGenericContext
        type = mono_type_retrieve_from_typespec (image, type_token, context, &inflated, error);
 
        if (!type) {
-               g_assert (!mono_loader_get_last_error ());
+               mono_loader_assert_no_error ();
                return NULL;
        }
 
index 0b35809e33260ef612d2c6b96a7b3a062080470c..4c66a1fba2c4e2373e85ead3427745a9463e16d0 100644 (file)
@@ -752,9 +752,14 @@ mono_method_get_name_full (MonoMethod *method, gboolean signature, MonoTypeNameF
 {
        char *res;
        char wrapper [64];
-       char *klass_desc = mono_type_get_name_full (&method->klass->byval_arg, format);
+       char *klass_desc;
        char *inst_desc = NULL;
 
+       if (format == MONO_TYPE_NAME_FORMAT_IL)
+               klass_desc = mono_type_full_name (&method->klass->byval_arg);
+       else
+               klass_desc = mono_type_get_name_full (&method->klass->byval_arg, format);
+
        if (method->is_inflated && ((MonoMethodInflated*)method)->context.method_inst) {
                GString *str = g_string_new ("");
                if (format == MONO_TYPE_NAME_FORMAT_IL)
index e5001cdecccdb0222c3befb8ca2c4f5d76e2962f..37b71880d80936898afedcf3efff4441d9ee61ad 100644 (file)
@@ -812,12 +812,9 @@ ICALL(SECSTRING_2, "EncryptInternal", ves_icall_System_Security_SecureString_Enc
 #endif /* !DISABLE_POLICY_EVIDENCE */
 
 ICALL_TYPE(SECMAN, "System.Security.SecurityManager", SECMAN_1)
-ICALL(SECMAN_1, "GetLinkDemandSecurity", ves_icall_System_Security_SecurityManager_GetLinkDemandSecurity)
-ICALL(SECMAN_2, "get_CheckExecutionRights", ves_icall_System_Security_SecurityManager_get_CheckExecutionRights)
-ICALL(SECMAN_3, "get_RequiresElevatedPermissions", mono_security_core_clr_require_elevated_permissions)
-ICALL(SECMAN_4, "get_SecurityEnabled", ves_icall_System_Security_SecurityManager_get_SecurityEnabled)
-ICALL(SECMAN_5, "set_CheckExecutionRights", ves_icall_System_Security_SecurityManager_set_CheckExecutionRights)
-ICALL(SECMAN_6, "set_SecurityEnabled", ves_icall_System_Security_SecurityManager_set_SecurityEnabled)
+ICALL(SECMAN_1, "get_RequiresElevatedPermissions", mono_security_core_clr_require_elevated_permissions)
+ICALL(SECMAN_2, "get_SecurityEnabled", ves_icall_System_Security_SecurityManager_get_SecurityEnabled)
+ICALL(SECMAN_3, "set_SecurityEnabled", ves_icall_System_Security_SecurityManager_set_SecurityEnabled)
 
 ICALL_TYPE(STRING, "System.String", STRING_1)
 ICALL(STRING_1, ".ctor(char*)", ves_icall_System_String_ctor_RedirectToCreateString)
index d4f5a2628f0ab8d233d0df1ad12001a5bd64a09a..ef680e12a1e2807038b42d93f1deb39c785ed06a 100644 (file)
@@ -4904,7 +4904,7 @@ mono_module_get_types (MonoDomain *domain, MonoImage *image, MonoArray **excepti
                if (!exportedOnly || mono_module_type_is_visible (tdef, image, i + 1)) {
                        MonoError error;
                        klass = mono_class_get_checked (image, (i + 1) | MONO_TOKEN_TYPE_DEF, &error);
-                       g_assert (!mono_loader_get_last_error ()); /* Plug any leaks */
+                       mono_loader_assert_no_error (); /* Plug any leaks */
                        
                        if (klass) {
                                mono_array_setref (res, count, mono_type_get_object (domain, &klass->byval_arg));
index 05cc3f7f83358d9caa035fb1985d7caf4a648938..89047003aa32a9e07298535151bd77a60cfe8895 100644 (file)
@@ -287,6 +287,17 @@ mono_loader_get_last_error (void)
        return (MonoLoaderError*)mono_native_tls_get_value (loader_error_thread_id);
 }
 
+void
+mono_loader_assert_no_error (void)
+{
+       MonoLoaderError *error = mono_loader_get_last_error ();
+
+       if (error) {
+               g_print ("Unhandled loader error: %x, %s %s %s\n", error->exception_type, error->msg, error->assembly_name, error->class_name);
+               g_assert_not_reached ();
+       }
+}
+
 /**
  * mono_loader_clear_error:
  *
@@ -511,7 +522,7 @@ field_from_memberref (MonoImage *image, guint32 token, MonoClass **retklass,
        field = mono_class_get_field_from_name_full (klass, fname, sig_type);
 
        if (!field) {
-               g_assert (!mono_loader_get_last_error ());
+               mono_loader_assert_no_error ();
                mono_error_set_field_load (error, klass, fname, "Could not find field '%s'", fname);
        }
 
@@ -527,7 +538,7 @@ mono_field_from_token (MonoImage *image, guint32 token, MonoClass **retklass, Mo
 {
        MonoError error;
        MonoClassField *res = mono_field_from_token_checked (image, token, retklass, context, &error);
-       g_assert (!mono_loader_get_last_error ());
+       mono_loader_assert_no_error ();
        if (!mono_error_ok (&error)) {
                mono_loader_set_error_from_mono_error (&error);
                mono_error_cleanup (&error);
@@ -566,7 +577,7 @@ mono_field_from_token_checked (MonoImage *image, guint32 token, MonoClass **retk
 
        if (mono_metadata_token_table (token) == MONO_TABLE_MEMBERREF) {
                field = field_from_memberref (image, token, retklass, context, error);
-               g_assert (!mono_loader_get_last_error ());
+               mono_loader_assert_no_error ();
        } else {
                type = mono_metadata_typedef_from_field (image, mono_metadata_token_index (token));
                if (!type) {
@@ -592,7 +603,7 @@ mono_field_from_token_checked (MonoImage *image, guint32 token, MonoClass **retk
        if (field && field->parent && !field->parent->generic_class && !field->parent->generic_container)
                mono_conc_hashtable_insert (image->field_cache, GUINT_TO_POINTER (token), field);
 
-       g_assert (!mono_loader_get_last_error ());
+       mono_loader_assert_no_error ();
        return field;
 }
 
@@ -890,7 +901,7 @@ mono_method_get_signature_full (MonoMethod *method, MonoImage *image, guint32 to
        MonoError error;
        MonoMethodSignature *res = mono_method_get_signature_checked (method, image, token, context, &error);
 
-       g_assert (!mono_loader_get_last_error ());
+       mono_loader_assert_no_error ();
 
        if (!res) {
                g_assert (!mono_error_ok (&error));
@@ -991,7 +1002,7 @@ mono_method_get_signature (MonoMethod *method, MonoImage *image, guint32 token)
        MonoError error;
        MonoMethodSignature *res = mono_method_get_signature_checked (method, image, token, NULL, &error);
 
-       g_assert (!mono_loader_get_last_error ());
+       mono_loader_assert_no_error ();
 
        if (!res) {
                g_assert (!mono_error_ok (&error));
@@ -1143,11 +1154,11 @@ method_from_memberref (MonoImage *image, guint32 idx, MonoGenericContext *typesp
                g_free (msig);
        }
 
-       g_assert (!mono_loader_get_last_error ());
+       mono_loader_assert_no_error ();
        return method;
 
 fail:
-       g_assert (!mono_loader_get_last_error ());
+       mono_loader_assert_no_error ();
        g_assert (!mono_error_ok (error));
        return NULL;
 }
@@ -1183,7 +1194,7 @@ method_from_methodspec (MonoImage *image, MonoGenericContext *context, guint32 i
 
        inst = mono_metadata_parse_generic_inst (image, NULL, param_count, ptr, &ptr);
        if (!inst) {
-               g_assert (!mono_loader_get_last_error ());
+               mono_loader_assert_no_error ();
                mono_error_set_bad_image (error, image, "Cannot parse generic instance for methodspec 0x%08x", idx);
                return NULL;
        }
@@ -1216,7 +1227,7 @@ method_from_methodspec (MonoImage *image, MonoGenericContext *context, guint32 i
        new_context.method_inst = inst;
 
        method = mono_class_inflate_generic_method_full_checked (method, klass, &new_context, error);
-       g_assert (!mono_loader_get_last_error ());
+       mono_loader_assert_no_error ();
        return method;
 }
 
@@ -1488,7 +1499,7 @@ mono_lookup_pinvoke_call (MonoMethod *method, const char **exc_class, const char
        /*
         * Try loading the module using a variety of names
         */
-       for (i = 0; i < 4; ++i) {
+       for (i = 0; i < 5; ++i) {
                char *base_name = NULL, *dir_name = NULL;
                gboolean is_absolute = is_absolute_path (new_scope);
                
@@ -1522,6 +1533,14 @@ mono_lookup_pinvoke_call (MonoMethod *method, const char **exc_class, const char
                                break;
                        }
                        continue;
+               case 3:
+                       if (!is_absolute && mono_dl_get_system_dir ()) {
+                               dir_name = mono_dl_get_system_dir ();
+                               file_name = g_path_get_basename (new_scope);
+                               base_name = NULL;
+                       } else
+                               continue;
+                       break;
                default:
 #ifndef TARGET_WIN32
                        if (!g_ascii_strcasecmp ("user32.dll", new_scope) ||
@@ -1784,7 +1803,7 @@ mono_get_method_from_token (MonoImage *image, guint32 token, MonoClass *klass,
                MonoClass *handle_class;
 
                result = mono_lookup_dynamic_token_class (image, token, TRUE, &handle_class, context);
-               g_assert (!mono_loader_get_last_error ());
+               mono_loader_assert_no_error ();
 
                // This checks the memberref type as well
                if (result && handle_class != mono_defaults.methodhandle_class) {
@@ -1855,7 +1874,7 @@ mono_get_method_from_token (MonoImage *image, guint32 token, MonoClass *klass,
         */
        if (*sig & 0x10) {
                generic_container = mono_metadata_load_generic_params (image, token, container);
-               g_assert (!mono_loader_get_last_error ()); /* FIXME don't swallow this error. */
+               mono_loader_assert_no_error (); /* FIXME don't swallow this error. */
        }
        if (generic_container) {
                result->is_generic = TRUE;
@@ -1889,7 +1908,7 @@ mono_get_method_from_token (MonoImage *image, guint32 token, MonoClass *klass,
        if (generic_container)
                mono_method_set_generic_container (result, generic_container);
 
-       g_assert (!mono_loader_get_last_error ());
+       mono_loader_assert_no_error ();
        return result;
 }
 
@@ -1905,7 +1924,7 @@ mono_get_method_full (MonoImage *image, guint32 token, MonoClass *klass,
 {
        MonoError error;
        MonoMethod *result = mono_get_method_checked (image, token, klass, context, &error);
-       g_assert (!mono_loader_get_last_error ());
+       mono_loader_assert_no_error ();
        if (!mono_error_ok (&error)) {
                mono_loader_set_error_from_mono_error (&error);
                mono_error_cleanup (&error);
@@ -2053,7 +2072,7 @@ mono_get_method_constrained (MonoImage *image, guint32 token, MonoClass *constra
        MonoError error;
        MonoMethod *result = mono_get_method_constrained_checked (image, token, constrained_class, context, cil_method, &error);
 
-       g_assert (!mono_loader_get_last_error ());
+       mono_loader_assert_no_error ();
        if (!mono_error_ok (&error)) {
                mono_loader_set_error_from_mono_error (&error);
                mono_error_cleanup (&error);
index 5697b59d3380fd4e18ed4fb82b3d808ace99e8c3..696d48e781adff3e168e079440db275b3be65a9d 100644 (file)
@@ -1979,13 +1979,13 @@ mono_metadata_parse_method_signature_full (MonoImage *m, MonoGenericContainer *c
        for (i = 0; i < method->param_count; ++i) {
                if (*ptr == MONO_TYPE_SENTINEL) {
                        if (method->call_convention != MONO_CALL_VARARG || def) {
-                               g_assert (!mono_loader_get_last_error ());
+                               mono_loader_assert_no_error ();
                                mono_error_set_bad_image (error, m, "Found sentinel for methoddef or no vararg");
                                g_free (pattrs);
                                return NULL;
                        }
                        if (method->sentinelpos >= 0) {
-                               g_assert (!mono_loader_get_last_error ());
+                               mono_loader_assert_no_error ();
                                mono_error_set_bad_image (error, m, "Found sentinel twice in the same signature.");
                                g_free (pattrs);
                                return NULL;
@@ -2024,7 +2024,7 @@ mono_metadata_parse_method_signature_full (MonoImage *m, MonoGenericContainer *c
         * Add signature to a cache and increase ref count...
         */
 
-       g_assert (!mono_loader_get_last_error ());
+       mono_loader_assert_no_error ();
        return method;
 }
 
@@ -6065,7 +6065,7 @@ mono_metadata_load_generic_param_constraints_checked (MonoImage *image, guint32
                return TRUE;
        for (i = 0; i < container->type_argc; i++) {
                if (!get_constraints (image, start_row + i, &mono_generic_container_get_param_info (container, i)->constraints, container, error)) {
-                       g_assert (!mono_loader_get_last_error ());
+                       mono_loader_assert_no_error ();
                        return FALSE;
                }
        }
index 49f4abe3eb6acbfe6e2ad715b13b64e6db002bc2..cc42ab867a124b20915b2bd4ad431e0571da77a6 100644 (file)
@@ -180,7 +180,7 @@ DECL_OFFSET(MonoLMF, rip)
 
 DECL_OFFSET(DynCallArgs, res)
 
-DECL_OFFSET(MonoLMFTramp, regs)
+DECL_OFFSET(MonoLMFTramp, ctx)
 DECL_OFFSET(MonoLMFTramp, lmf_addr)
 #elif defined(TARGET_ARM)
 DECL_OFFSET(MonoLMF, sp)
index de98dda347697f2e233dd1a7aabf34d43bfc97ff..61595ddf2c4a64ffe3c84ca5da59800809452d41 100644 (file)
@@ -3,6 +3,7 @@
  *
  * Author:
  *   Paolo Molaro (lupus@ximian.com)
+ *   Alex Rønne Petersen (alexrp@xamarin.com)
  *
  * Copyright 2001-2003 Ximian, Inc (http://www.ximian.com)
  * Copyright 2004-2009 Novell, Inc (http://www.novell.com)
index abdeb14cb746a51173b1b3b9f9f5c58803d6d762..967cf6fd32068ad7a4b1b90c645deb811cb8a049 100644 (file)
@@ -119,20 +119,3 @@ void
 ves_icall_System_Security_SecurityManager_set_SecurityEnabled (MonoBoolean value)
 {
 }
-
-MonoBoolean
-ves_icall_System_Security_SecurityManager_get_CheckExecutionRights (void)
-{
-       return FALSE;
-}
-
-void
-ves_icall_System_Security_SecurityManager_set_CheckExecutionRights (MonoBoolean value)
-{
-}
-
-MonoBoolean
-ves_icall_System_Security_SecurityManager_GetLinkDemandSecurity (MonoReflectionMethod *m, MonoDeclSecurityActions *kactions, MonoDeclSecurityActions *mactions)
-{
-       return FALSE;
-}
index f08924f647b05ac2b751ec0a546d86cf1e960069..98fbbfd652169b5931dfcab650b008671f5c00f2 100644 (file)
@@ -61,9 +61,6 @@ MonoSecurityMode mono_security_get_mode (void);
 /* internal calls */
 MonoBoolean ves_icall_System_Security_SecurityManager_get_SecurityEnabled (void);
 void ves_icall_System_Security_SecurityManager_set_SecurityEnabled (MonoBoolean value);
-MonoBoolean ves_icall_System_Security_SecurityManager_get_CheckExecutionRights (void);
-void ves_icall_System_Security_SecurityManager_set_CheckExecutionRights (MonoBoolean value);
-MonoBoolean ves_icall_System_Security_SecurityManager_GetLinkDemandSecurity (MonoReflectionMethod *m, MonoDeclSecurityActions *kactions, MonoDeclSecurityActions *mactions);
 
 #ifndef DISABLE_SECURITY
 #define mono_security_core_clr_enabled() (mono_security_get_mode () == MONO_SECURITY_MODE_CORE_CLR)
index 7f79e92385965f9359ccd1a3ccea9e57b95259bf..9050c3b1d2f9d45bfaa907bc35d4c83330e5dc5d 100644 (file)
@@ -1060,6 +1060,7 @@ create_allocator (int atype, gboolean slowpath)
        int tlab_next_addr_var, new_next_var;
        const char *name = NULL;
        AllocatorWrapperInfo *info;
+       int num_params, i;
 
        if (!registered) {
                mono_register_jit_icall (mono_gc_alloc_obj, "mono_gc_alloc_obj", mono_create_icall_signature ("object ptr int"), FALSE);
@@ -1080,15 +1081,20 @@ create_allocator (int atype, gboolean slowpath)
                g_assert_not_reached ();
        }
 
-       csig = mono_metadata_signature_alloc (mono_defaults.corlib, 2);
+       if (atype == ATYPE_NORMAL)
+               num_params = 1;
+       else
+               num_params = 2;
+
+       csig = mono_metadata_signature_alloc (mono_defaults.corlib, num_params);
        if (atype == ATYPE_STRING) {
                csig->ret = &mono_defaults.string_class->byval_arg;
                csig->params [0] = &mono_defaults.int_class->byval_arg;
                csig->params [1] = &mono_defaults.int32_class->byval_arg;
        } else {
                csig->ret = &mono_defaults.object_class->byval_arg;
-               csig->params [0] = &mono_defaults.int_class->byval_arg;
-               csig->params [1] = &mono_defaults.int_class->byval_arg;
+               for (i = 0; i < num_params; i++)
+                       csig->params [i] = &mono_defaults.int_class->byval_arg;
        }
 
        mb = mono_mb_new (mono_defaults.object_class, name, MONO_WRAPPER_ALLOC);
index f6247cb5a09f934c72a84971b097638aa649f79f..6d8850767ce61548bf9d693dcfb151362080d784 100644 (file)
 // Ported from C++ to C and adjusted to Mono runtime
 
 #include <stdlib.h>
+#define _USE_MATH_DEFINES // needed by MSVC to define math constants
 #include <math.h>
 #include <config.h>
 #include <glib.h>
 
-#if !defined (HAVE_COMPLEX_H)
-#include <../../support/libm/complex.h>
-#else
-#include <complex.h>
-#endif
-
 #include <mono/metadata/class-internals.h>
 #include <mono/metadata/exception.h>
 #include <mono/metadata/gc-internal.h>
@@ -40,6 +35,7 @@
 #include <mono/metadata/threadpool-internals.h>
 #include <mono/utils/atomic.h>
 #include <mono/utils/mono-compiler.h>
+#include <mono/utils/mono-complex.h>
 #include <mono/utils/mono-proclib.h>
 #include <mono/utils/mono-threads.h>
 #include <mono/utils/mono-time.h>
@@ -925,7 +921,7 @@ hill_climbing_force_change (gint16 new_thread_count, ThreadPoolHeuristicStateTra
        }
 }
 
-static double complex
+static double_complex
 hill_climbing_get_wave_component (gdouble *samples, guint sample_count, gdouble period)
 {
        ThreadPoolHillClimbing *hc;
@@ -950,7 +946,7 @@ hill_climbing_get_wave_component (gdouble *samples, guint sample_count, gdouble
                q1 = q0;
        }
 
-       return ((q1 - q2 * cosine) + (q2 * sine) * I) / ((gdouble) sample_count);
+       return mono_double_complex_scalar_div (mono_double_complex_make (q1 - q2 * cosine, (q2 * sine)), ((gdouble)sample_count));
 }
 
 static gint16
@@ -967,9 +963,9 @@ hill_climbing_update (gint16 current_thread_count, guint32 sample_duration, gint
        gint sample_count;
        gint new_thread_wave_magnitude;
        gint new_thread_count;
-       double complex thread_wave_component;
-       double complex throughput_wave_component;
-       double complex ratio;
+       double_complex thread_wave_component;
+       double_complex throughput_wave_component;
+       double_complex ratio;
 
        g_assert (threadpool);
        g_assert (adjustment_interval);
@@ -1029,10 +1025,10 @@ hill_climbing_update (gint16 current_thread_count, guint32 sample_duration, gint
        hc->total_samples ++;
 
        /* Set up defaults for our metrics. */
-       thread_wave_component = 0;
-       throughput_wave_component = 0;
+       thread_wave_component = mono_double_complex_make(0, 0);
+       throughput_wave_component = mono_double_complex_make(0, 0);
        throughput_error_estimate = 0;
-       ratio = 0;
+       ratio = mono_double_complex_make(0, 0);
        confidence = 0;
 
        transition = TRANSITION_WARMUP;
@@ -1070,17 +1066,17 @@ hill_climbing_update (gint16 current_thread_count, guint32 sample_duration, gint
                        /* Get the the three different frequency components of the throughput (scaled by average
                         * throughput). Our "error" estimate (the amount of noise that might be present in the
                         * frequency band we're really interested in) is the average of the adjacent bands. */
-                       throughput_wave_component = hill_climbing_get_wave_component (hc->samples, sample_count, hc->wave_period) / average_throughput;
-                       throughput_error_estimate = cabs (hill_climbing_get_wave_component (hc->samples, sample_count, adjacent_period_1) / average_throughput);
+                       throughput_wave_component = mono_double_complex_scalar_div (hill_climbing_get_wave_component (hc->samples, sample_count, hc->wave_period), average_throughput);
+                       throughput_error_estimate = cabs (mono_double_complex_scalar_div (hill_climbing_get_wave_component (hc->samples, sample_count, adjacent_period_1), average_throughput));
 
                        if (adjacent_period_2 <= sample_count) {
-                               throughput_error_estimate = MAX (throughput_error_estimate, cabs (hill_climbing_get_wave_component (
-                                       hc->samples, sample_count, adjacent_period_2) / average_throughput));
+                               throughput_error_estimate = MAX (throughput_error_estimate, cabs (mono_double_complex_scalar_div (hill_climbing_get_wave_component (
+                                       hc->samples, sample_count, adjacent_period_2), average_throughput)));
                        }
 
                        /* Do the same for the thread counts, so we have something to compare to. We don't
                         * measure thread count noise, because there is none; these are exact measurements. */
-                       thread_wave_component = hill_climbing_get_wave_component (hc->thread_counts, sample_count, hc->wave_period) / average_thread_count;
+                       thread_wave_component = mono_double_complex_scalar_div (hill_climbing_get_wave_component (hc->thread_counts, sample_count, hc->wave_period), average_thread_count);
 
                        /* Update our moving average of the throughput noise. We'll use this
                         * later as feedback to determine the new size of the thread wave. */
@@ -1094,10 +1090,10 @@ hill_climbing_update (gint16 current_thread_count, guint32 sample_duration, gint
                        if (cabs (thread_wave_component) > 0) {
                                /* Adjust the throughput wave so it's centered around the target wave,
                                 * and then calculate the adjusted throughput/thread ratio. */
-                               ratio = (throughput_wave_component - (hc->target_throughput_ratio * thread_wave_component)) / thread_wave_component;
+                               ratio = mono_double_complex_div (mono_double_complex_sub (throughput_wave_component, mono_double_complex_scalar_mul(thread_wave_component, hc->target_throughput_ratio)), thread_wave_component);
                                transition = TRANSITION_CLIMBING_MOVE;
                        } else {
-                               ratio = 0;
+                               ratio = mono_double_complex_make (0, 0);
                                transition = TRANSITION_STABILIZING;
                        }
 
index 64d6543aca9adc31201430081967578eddec89c7..d1ca2c423651574f6c4333d71e74a5490e65eaed 100755 (executable)
@@ -766,7 +766,7 @@ patch-libtool:
        chmod a+x ../../libtool
 
 # Utility target for patching libtool to get rid of the 'ranlib: file <file> has no symbols" warnings
-patch-libtool-osx:
+patch-osx-libtool:
        sed -e 's/old_archive_cmds=.*/old_archive_cmds="libtool -no_warning_for_no_symbols -static -o \\$$oldlib \\$$oldobjs"/g' < ../../libtool > 2; mv 2 ../../libtool
        chmod a+x ../../libtool
 
index 2297d626186b3105687a319642fc0d3959d530e8..1aa05636260fa141ce57f393098e229ac5b3c660 100644 (file)
@@ -1167,24 +1167,25 @@ arch_emit_specific_trampoline_pages (MonoAotCompile *acfg)
        guint8 *code;
        guint8 *loop_start, *loop_branch_back, *loop_end_check, *imt_found_check;
        int i;
+       int pagesize = MONO_AOT_TRAMP_PAGE_SIZE;
 #define COMMON_TRAMP_SIZE 16
-       int count = (mono_pagesize () - COMMON_TRAMP_SIZE) / 8;
+       int count = (pagesize - COMMON_TRAMP_SIZE) / 8;
        int imm8, rot_amount;
        char symbol [128];
 
        if (!acfg->aot_opts.use_trampolines_page)
                return;
 
-       acfg->tramp_page_size = mono_pagesize ();
+       acfg->tramp_page_size = pagesize;
 
        sprintf (symbol, "%sspecific_trampolines_page", acfg->user_symbol_prefix);
-       emit_alignment (acfg, mono_pagesize ());
+       emit_alignment (acfg, pagesize);
        emit_global (acfg, symbol, TRUE);
        emit_label (acfg, symbol);
 
        /* emit the generic code first, the trampoline address + 8 is in the lr register */
        code = buf;
-       imm8 = mono_arm_is_rotated_imm8 (mono_pagesize (), &rot_amount);
+       imm8 = mono_arm_is_rotated_imm8 (pagesize, &rot_amount);
        ARM_SUB_REG_IMM (code, ARMREG_LR, ARMREG_LR, imm8, rot_amount);
        ARM_LDR_IMM (code, ARMREG_R1, ARMREG_LR, -8);
        ARM_LDR_IMM (code, ARMREG_PC, ARMREG_LR, -4);
@@ -1212,7 +1213,7 @@ arch_emit_specific_trampoline_pages (MonoAotCompile *acfg)
        emit_global (acfg, symbol, TRUE);
        emit_label (acfg, symbol);
        code = buf;
-       imm8 = mono_arm_is_rotated_imm8 (mono_pagesize (), &rot_amount);
+       imm8 = mono_arm_is_rotated_imm8 (pagesize, &rot_amount);
        ARM_SUB_REG_IMM (code, ARMREG_IP, ARMREG_IP, imm8, rot_amount);
        ARM_LDR_IMM (code, MONO_ARCH_RGCTX_REG, ARMREG_IP, -8);
        ARM_LDR_IMM (code, ARMREG_PC, ARMREG_IP, -4);
@@ -1239,7 +1240,7 @@ arch_emit_specific_trampoline_pages (MonoAotCompile *acfg)
        emit_label (acfg, symbol);
        code = buf;
        ARM_PUSH (code, (1 << ARMREG_R0) | (1 << ARMREG_R1) | (1 << ARMREG_R2) | (1 << ARMREG_R3));
-       imm8 = mono_arm_is_rotated_imm8 (mono_pagesize (), &rot_amount);
+       imm8 = mono_arm_is_rotated_imm8 (pagesize, &rot_amount);
        ARM_SUB_REG_IMM (code, ARMREG_IP, ARMREG_IP, imm8, rot_amount);
        ARM_LDR_IMM (code, ARMREG_R0, ARMREG_IP, -8);
        ARM_LDR_IMM (code, ARMREG_PC, ARMREG_IP, -4);
@@ -1269,7 +1270,7 @@ arch_emit_specific_trampoline_pages (MonoAotCompile *acfg)
        /* Need at least two free registers, plus a slot for storing the pc */
        ARM_PUSH (code, (1 << ARMREG_R0)|(1 << ARMREG_R1)|(1 << ARMREG_R2));
 
-       imm8 = mono_arm_is_rotated_imm8 (mono_pagesize (), &rot_amount);
+       imm8 = mono_arm_is_rotated_imm8 (pagesize, &rot_amount);
        ARM_SUB_REG_IMM (code, ARMREG_IP, ARMREG_IP, imm8, rot_amount);
        ARM_LDR_IMM (code, ARMREG_R0, ARMREG_IP, -8);
 
@@ -3261,7 +3262,7 @@ add_method (MonoAotCompile *acfg, MonoMethod *method)
 static void
 add_extra_method_with_depth (MonoAotCompile *acfg, MonoMethod *method, int depth)
 {
-       if (mono_method_is_generic_sharable_full (method, FALSE, TRUE, FALSE))
+       if (mono_method_is_generic_sharable_full (method, TRUE, TRUE, FALSE))
                method = mini_get_shared_method (method);
        else if ((acfg->opts & MONO_OPT_GSHAREDVT) && prefer_gsharedvt_method (acfg, method) && mono_method_is_generic_sharable_full (method, FALSE, FALSE, TRUE))
                /* Use the gsharedvt version */
@@ -4231,6 +4232,42 @@ add_generic_class_with_depth (MonoAotCompile *acfg, MonoClass *klass, int depth,
                        add_generic_class (acfg, mono_class_inflate_generic_class (gcomparer, &ctx), FALSE, "EqualityComparer<T>");
                }
        }
+
+       /* Add an instance of EnumComparer<T> which is created dynamically by EqualityComparer<T> for enums */
+       if (klass->image == mono_defaults.corlib && !strcmp (klass->name_space, "System.Collections.Generic") && !strcmp (klass->name, "EqualityComparer`1")) {
+               MonoClass *enum_comparer;
+               MonoClass *tclass = mono_class_from_mono_type (klass->generic_class->context.class_inst->type_argv [0]);
+               MonoGenericContext ctx;
+               MonoType *args [16];
+
+               if (mono_class_is_enum (tclass)) {
+                       memset (&ctx, 0, sizeof (ctx));
+                       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);
+                       add_generic_class (acfg, mono_class_inflate_generic_class (enum_comparer, &ctx), FALSE, "EqualityComparer<T>");
+               }
+       }
+
+       /* Add an instance of ObjectComparer<T> which is created dynamically by Comparer<T> for enums */
+       if (klass->image == mono_defaults.corlib && !strcmp (klass->name_space, "System.Collections.Generic") && !strcmp (klass->name, "Comparer`1")) {
+               MonoClass *comparer;
+               MonoClass *tclass = mono_class_from_mono_type (klass->generic_class->context.class_inst->type_argv [0]);
+               MonoGenericContext ctx;
+               MonoType *args [16];
+
+               if (mono_class_is_enum (tclass)) {
+                       memset (&ctx, 0, sizeof (ctx));
+                       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);
+                       add_generic_class (acfg, mono_class_inflate_generic_class (comparer, &ctx), FALSE, "Comparer<T>");
+               }
+       }
 }
 
 static void
@@ -5359,7 +5396,6 @@ static void
 emit_method_info (MonoAotCompile *acfg, MonoCompile *cfg)
 {
        MonoMethod *method;
-       GList *l;
        int pindex, buf_size, n_patches;
        GPtrArray *patches;
        MonoJumpInfo *patch_info;
@@ -5392,16 +5428,7 @@ emit_method_info (MonoAotCompile *acfg, MonoCompile *cfg)
                /* Not needed when loading the method */
                encode_value (0, p, &p);
 
-       /* String table */
-       if (cfg->opt & MONO_OPT_SHARED) {
-               encode_value (g_list_length (cfg->ldstr_list), p, &p);
-               for (l = cfg->ldstr_list; l; l = l->next) {
-                       encode_value ((long)l->data, p, &p);
-               }
-       }
-       else
-               /* Used only in shared mode */
-               g_assert (!cfg->ldstr_list);
+       g_assert (!(cfg->opt & MONO_OPT_SHARED));
 
        n_patches = 0;
        for (pindex = 0; pindex < patches->len; ++pindex) {
@@ -6175,8 +6202,6 @@ emit_trampolines (MonoAotCompile *acfg)
                        emit_trampoline (acfg, acfg->got_offset, info);
                }
 
-               mono_arch_get_nullified_class_init_trampoline (&info);
-               emit_trampoline (acfg, acfg->got_offset, info);
 #if defined(MONO_ARCH_MONITOR_OBJECT_REG)
                mono_arch_create_monitor_enter_trampoline (&info, FALSE, TRUE);
                emit_trampoline (acfg, acfg->got_offset, info);
@@ -6918,9 +6943,9 @@ compile_method (MonoAotCompile *acfg, MonoMethod *method)
                                if (m->is_inflated) {
                                        if (!(mono_class_generic_sharing_enabled (m->klass) &&
                                                  mono_method_is_generic_sharable_full (m, FALSE, FALSE, FALSE)) &&
-                                               !method_has_type_vars (m)) {
+                                               (!method_has_type_vars (m) || mono_method_is_generic_sharable_full (m, TRUE, TRUE, FALSE))) {
                                                if (m->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL) {
-                                                       if (mono_aot_mode_is_full (&acfg->aot_opts))
+                                                       if (mono_aot_mode_is_full (&acfg->aot_opts) && !method_has_type_vars (m))
                                                                add_extra_method_with_depth (acfg, mono_marshal_get_native_wrapper (m, TRUE, TRUE), depth + 1);
                                                } else {
                                                        add_extra_method_with_depth (acfg, m, depth + 1);
@@ -8510,11 +8535,6 @@ emit_file_info (MonoAotCompile *acfg)
                emit_pointer (acfg, NULL);
                emit_pointer (acfg, NULL);
        }
-       if (acfg->thumb_mixed) {
-               emit_pointer (acfg, "thumb_end");
-       } else {
-               emit_pointer (acfg, NULL);
-       }
        if (acfg->aot_opts.static_link) {
                emit_pointer (acfg, "globals");
        } else {
@@ -8718,6 +8738,10 @@ collect_methods (MonoAotCompile *acfg)
                }
                */
 
+               if (method->is_generic || method->klass->generic_container)
+                       /* Compile the ref shared version instead */
+                       method = mini_get_shared_method (method);
+
                /* Since we add the normal methods first, their index will be equal to their zero based token index */
                add_method_with_index (acfg, method, i, FALSE);
                acfg->method_index ++;
@@ -8735,14 +8759,6 @@ collect_methods (MonoAotCompile *acfg)
                method = mono_get_method_checked (acfg->image, token, NULL, NULL, &error);
                report_loader_error (acfg, &error, "Failed to load method token 0x%x due to %s\n", i, mono_error_get_message (&error));
 
-               /*
-               if (strcmp (method->name, "gshared2"))
-                       continue;
-               */
-               /*
-               if (!strstr (method->klass->image->name, "mini"))
-                       continue;
-               */
                if (method->is_generic || method->klass->generic_container) {
                        MonoMethod *gshared;
 
@@ -9351,8 +9367,14 @@ mono_compile_assembly (MonoAssembly *ass, guint32 opts, const char *aot_options)
                 * Emit all LLVM code into a separate assembly/object file and link with it
                 * normally.
                 */
-               if (!acfg->aot_opts.asm_only)
+               if (!acfg->aot_opts.asm_only) {
                        acfg->llvm_owriter = TRUE;
+               } else if (acfg->aot_opts.llvm_outfile) {
+                       int len = strlen (acfg->aot_opts.llvm_outfile);
+
+                       if (len >= 2 && acfg->aot_opts.llvm_outfile [len - 2] == '.' && acfg->aot_opts.llvm_outfile [len - 1] == 'o')
+                               acfg->llvm_owriter = TRUE;
+               }
        }
 
        if (mono_aot_mode_is_full (&acfg->aot_opts))
@@ -9382,6 +9404,9 @@ mono_compile_assembly (MonoAssembly *ass, guint32 opts, const char *aot_options)
 
        arch_init (acfg);
 
+       if (acfg->llvm && acfg->thumb_mixed)
+               acfg->flags |= MONO_AOT_FILE_FLAG_LLVM_THUMB;
+
        acfg->assembly_name_sym = g_strdup (acfg->image->assembly->aname.name);
        /* Get rid of characters which cannot occur in symbols */
        for (p = acfg->assembly_name_sym; *p; ++p) {
@@ -9479,6 +9504,10 @@ mono_compile_assembly (MonoAssembly *ass, guint32 opts, const char *aot_options)
                        }
                        g_assert (acfg->aot_opts.llvm_outfile);
                        acfg->llvm_sfile = g_strdup (acfg->aot_opts.llvm_outfile);
+                       if (acfg->llvm_owriter)
+                               acfg->llvm_ofile = g_strdup (acfg->aot_opts.llvm_outfile);
+                       else
+                               acfg->llvm_sfile = g_strdup (acfg->aot_opts.llvm_outfile);
                } else {
                        acfg->tmpbasename = g_strdup_printf ("%s", "temp");
                        acfg->tmpfname = g_strdup_printf ("%s.s", acfg->tmpbasename);
@@ -9571,21 +9600,6 @@ mono_compile_assembly (MonoAssembly *ass, guint32 opts, const char *aot_options)
        if (acfg->dwarf)
                mono_dwarf_writer_emit_base_info (acfg->dwarf, g_path_get_basename (acfg->image->name), mono_unwind_get_cie_program ());
 
-       if (acfg->thumb_mixed) {
-               char symbol [256];
-               /*
-                * This global symbol marks the end of THUMB code, and the beginning of ARM
-                * code generated by our JIT.
-                */
-               sprintf (symbol, "thumb_end");
-               emit_section_change (acfg, ".text", 0);
-               emit_alignment_code (acfg, 8);
-               emit_label (acfg, symbol);
-               emit_zero_bytes (acfg, 16);
-
-               fprintf (acfg->fp, ".arm\n");
-       }
-
        emit_code (acfg);
 
        emit_info (acfg);
index 5f0672adadf4056223b6704937fd6d8f26172735..63e184e5945671ced4eee67bc21c1e9b5ca27abb 100644 (file)
@@ -123,7 +123,6 @@ typedef struct MonoAotModule {
        guint32 *unbox_trampolines_end;
        guint32 *unbox_trampoline_addresses;
        guint8 *unwind_info;
-       guint8 *thumb_end;
 
        /* Points to the mono EH data created by LLVM */
        guint8 *mono_eh_frame;
@@ -207,6 +206,9 @@ init_plt (MonoAotModule *info);
 static void
 compute_llvm_code_range (MonoAotModule *amodule, guint8 **code_start, guint8 **code_end);
 
+static gboolean
+mono_aot_init_method (MonoAotModule *amodule, guint32 method_index, MonoMethod *method, MonoClass **klass);
+
 /*****************************************************/
 /*                 AOT RUNTIME                       */
 /*****************************************************/
@@ -838,7 +840,10 @@ decode_method_ref_with_target (MonoAotModule *module, MethodRef *ref, MonoMethod
                        if (!m)
                                return FALSE;
                        mono_class_init (m->klass);
-                       ref->method = mono_marshal_get_remoting_invoke_with_check (m);
+                       if (mono_aot_only)
+                               ref->method = m;
+                       else
+                               ref->method = mono_marshal_get_remoting_invoke_with_check (m);
                        break;
                }
                case MONO_WRAPPER_PROXY_ISINST: {
@@ -1960,7 +1965,6 @@ load_aot_module (MonoAssembly *assembly, gpointer user_data)
        amodule->trampolines [MONO_AOT_TRAMP_STATIC_RGCTX] = info->static_rgctx_trampolines;
        amodule->trampolines [MONO_AOT_TRAMP_IMT_THUNK] = info->imt_thunks;
        amodule->trampolines [MONO_AOT_TRAMP_GSHAREDVT_ARG] = info->gsharedvt_arg_trampolines;
-       amodule->thumb_end = info->thumb_end;
 
        /* Compute code_offsets from the method addresses */
        amodule->code_offsets = g_malloc0 (amodule->info.nmethods * sizeof (gint32));
@@ -2407,6 +2411,15 @@ compute_llvm_code_range (MonoAotModule *amodule, guint8 **code_start, guint8 **c
        }
 }
 
+static gboolean
+is_thumb_code (MonoAotModule *amodule, guint8 *code)
+{
+       if ((amodule->info.flags & MONO_AOT_FILE_FLAG_LLVM_THUMB) && (guint8*)code >= amodule->llvm_code_start && (guint8*)code < amodule->llvm_code_end)
+               return TRUE;
+       else
+               return FALSE;
+}
+
 /*
  * decode_mono_eh_frame:
  *
@@ -2491,7 +2504,7 @@ decode_llvm_mono_eh_frame (MonoAotModule *amodule, MonoDomain *domain,
 
        g_assert (code >= code_start && code < code_end);
 
-       if (amodule->thumb_end && (guint8*)code_start < amodule->thumb_end)
+       if (is_thumb_code (amodule, code_start))
                /* Clear thumb flag */
                code_start = (guint8*)(((mgreg_t)code_start) & ~1);
 
@@ -2557,9 +2570,12 @@ decode_llvm_mono_eh_frame (MonoAotModule *amodule, MonoDomain *domain,
                jei->handler_start = ei [i].handler_start;
                jei->clause_index = clause_index;
 
-               /* Make sure we transition to thumb when a handler starts */
-               if (amodule->thumb_end && (guint8*)jei->handler_start < amodule->thumb_end)
+               if (is_thumb_code (amodule, jei->try_start)) {
+                       jei->try_start = (void*)((mgreg_t)jei->try_start & ~1);
+                       jei->try_end = (void*)((mgreg_t)jei->try_end & ~1);
+                       /* Make sure we transition to thumb when a handler starts */
                        jei->handler_start = (void*)((mgreg_t)jei->handler_start + 1);
+               }
        }
 
        /* See exception_cb () in mini-llvm.c as to why this is needed */
@@ -3563,12 +3579,9 @@ load_method (MonoDomain *domain, MonoAotModule *amodule, MonoImage *image, MonoM
 {
        MonoClass *klass;
        gboolean from_plt = method == NULL;
-       MonoMemPool *mp;
-       int i, pindex, n_patches, used_strings;
-       gboolean keep_patches = TRUE;
-       guint8 *p;
        MonoJitInfo *jinfo = NULL;
        guint8 *code, *info;
+       gboolean res;
 
        if (mono_profiler_get_events () & MONO_PROFILE_ENTER_LEAVE) {
                if (mono_aot_only)
@@ -3577,7 +3590,7 @@ load_method (MonoDomain *domain, MonoAotModule *amodule, MonoImage *image, MonoM
                return NULL;
        }
 
-       if ((domain != mono_get_root_domain ()) && (!(amodule->info.opts & MONO_OPT_SHARED)))
+       if (domain != mono_get_root_domain ())
                /* Non shared AOT code can't be used in other appdomains */
                return NULL;
 
@@ -3632,85 +3645,9 @@ load_method (MonoDomain *domain, MonoAotModule *amodule, MonoImage *image, MonoM
                }
        }
 
-       p = info;
-
-       if (method) {
-               klass = method->klass;
-               decode_klass_ref (amodule, p, &p);
-       } else {
-               klass = decode_klass_ref (amodule, p, &p);
-       }
-
-       if (amodule->info.opts & MONO_OPT_SHARED)
-               used_strings = decode_value (p, &p);
-       else
-               used_strings = 0;
-
-       for (i = 0; i < used_strings; i++) {
-               guint token = decode_value (p, &p);
-               mono_ldstr (mono_get_root_domain (), image, mono_metadata_token_index (token));
-       }
-
-       if (amodule->info.opts & MONO_OPT_SHARED)       
-               keep_patches = FALSE;
-
-       n_patches = decode_value (p, &p);
-
-       keep_patches = FALSE;
-
-       if (n_patches) {
-               MonoJumpInfo *patches;
-               guint32 *got_slots;
-               gboolean llvm;
-               gpointer *got;
-
-               if (keep_patches)
-                       mp = domain->mp;
-               else
-                       mp = mono_mempool_new ();
-
-               if ((gpointer)code >= amodule->info.jit_code_start && (gpointer)code <= amodule->info.jit_code_end) {
-                       llvm = FALSE;
-                       got = amodule->got;
-               } else {
-                       llvm = TRUE;
-                       got = amodule->llvm_got;
-                       g_assert (got);
-               }
-
-               patches = load_patch_info (amodule, mp, n_patches, llvm, &got_slots, p, &p);
-               if (patches == NULL)
-                       goto cleanup;
-
-               for (pindex = 0; pindex < n_patches; ++pindex) {
-                       MonoJumpInfo *ji = &patches [pindex];
-                       gpointer addr;
-
-                       /*
-                        * For SFLDA, we need to call resolve_patch_target () since the GOT slot could have
-                        * been initialized by load_method () for a static cctor before the cctor has
-                        * finished executing (#23242).
-                        */
-                       if (!got [got_slots [pindex]] || ji->type == MONO_PATCH_INFO_SFLDA) {
-                               addr = mono_resolve_patch_target (method, domain, code, ji, TRUE);
-                               if (ji->type == MONO_PATCH_INFO_METHOD_JUMP)
-                                       addr = mono_create_ftnptr (domain, addr);
-                               mono_memory_barrier ();
-                               got [got_slots [pindex]] = addr;
-                               if (ji->type == MONO_PATCH_INFO_METHOD_JUMP)
-                                       register_jump_target_got_slot (domain, ji->data.method, &(got [got_slots [pindex]]));
-                       }
-                       ji->type = MONO_PATCH_INFO_NONE;
-               }
-
-               g_free (got_slots);
-
-               if (!keep_patches)
-                       mono_mempool_destroy (mp);
-       }
-
-       if (mini_get_debug_options ()->load_aot_jit_info_eagerly)
-               jinfo = mono_aot_find_jit_info (domain, amodule->assembly->image, code);
+       res = mono_aot_init_method (amodule, method_index, method, &klass);
+       if (!res)
+               goto cleanup;
 
        if (mono_trace_is_traced (G_LOG_LEVEL_DEBUG, MONO_TRACE_AOT)) {
                char *full_name;
@@ -3744,7 +3681,7 @@ load_method (MonoDomain *domain, MonoAotModule *amodule, MonoImage *image, MonoM
                MonoJitInfo *jinfo;
 
                if (!method) {
-                       method = mono_get_method (image, token, NULL);
+                       method = mono_get_method (amodule->assembly->image, token, NULL);
                        g_assert (method);
                }
                mono_profiler_method_jit (method);
@@ -3759,11 +3696,6 @@ load_method (MonoDomain *domain, MonoAotModule *amodule, MonoImage *image, MonoM
        return code;
 
  cleanup:
-       /* FIXME: The space in domain->mp is wasted */  
-       if (amodule->info.opts & MONO_OPT_SHARED)
-               /* No need to cache patches */
-               mono_mempool_destroy (mp);
-
        if (jinfo)
                g_free (jinfo);
 
@@ -3911,6 +3843,89 @@ mono_aot_find_method_index (MonoMethod *method)
        return find_aot_method (method, &out_amodule);
 }
 
+static gboolean
+mono_aot_init_method (MonoAotModule *amodule, guint32 method_index, MonoMethod *method, MonoClass **klass)
+{
+       MonoDomain *domain = mono_domain_get ();
+       MonoMemPool *mp;
+       int pindex, n_patches;
+       guint8 *p;
+       MonoJitInfo *jinfo = NULL;
+       guint8 *code, *info;
+
+       code = &amodule->code [amodule->code_offsets [method_index]];
+       info = &amodule->blob [mono_aot_get_offset (amodule->method_info_offsets, method_index)];
+
+       p = info;
+
+       if (method) {
+               *klass = method->klass;
+               decode_klass_ref (amodule, p, &p);
+       } else {
+               *klass = decode_klass_ref (amodule, p, &p);
+       }
+
+       n_patches = decode_value (p, &p);
+
+       if (n_patches) {
+               MonoJumpInfo *patches;
+               guint32 *got_slots;
+               gboolean llvm;
+               gpointer *got;
+
+               mp = mono_mempool_new ();
+
+               if ((gpointer)code >= amodule->info.jit_code_start && (gpointer)code <= amodule->info.jit_code_end) {
+                       llvm = FALSE;
+                       got = amodule->got;
+               } else {
+                       llvm = TRUE;
+                       got = amodule->llvm_got;
+                       g_assert (got);
+               }
+
+               patches = load_patch_info (amodule, mp, n_patches, llvm, &got_slots, p, &p);
+               if (patches == NULL)
+                       goto cleanup;
+
+               for (pindex = 0; pindex < n_patches; ++pindex) {
+                       MonoJumpInfo *ji = &patches [pindex];
+                       gpointer addr;
+
+                       /*
+                        * For SFLDA, we need to call resolve_patch_target () since the GOT slot could have
+                        * been initialized by load_method () for a static cctor before the cctor has
+                        * finished executing (#23242).
+                        */
+                       if (!got [got_slots [pindex]] || ji->type == MONO_PATCH_INFO_SFLDA) {
+                               addr = mono_resolve_patch_target (method, domain, code, ji, TRUE);
+                               if (ji->type == MONO_PATCH_INFO_METHOD_JUMP)
+                                       addr = mono_create_ftnptr (domain, addr);
+                               mono_memory_barrier ();
+                               got [got_slots [pindex]] = addr;
+                               if (ji->type == MONO_PATCH_INFO_METHOD_JUMP)
+                                       register_jump_target_got_slot (domain, ji->data.method, &(got [got_slots [pindex]]));
+                       }
+                       ji->type = MONO_PATCH_INFO_NONE;
+               }
+
+               g_free (got_slots);
+
+               mono_mempool_destroy (mp);
+       }
+
+       if (mini_get_debug_options ()->load_aot_jit_info_eagerly)
+               jinfo = mono_aot_find_jit_info (domain, amodule->assembly->image, code);
+
+       return TRUE;
+
+ cleanup:
+       if (jinfo)
+               g_free (jinfo);
+
+       return FALSE;
+}
+
 /*
  * mono_aot_get_method:
  *
@@ -4344,10 +4359,8 @@ mono_aot_get_plt_entry (guint8 *code)
                return NULL;
 
 #ifdef TARGET_ARM
-       if (amodule->thumb_end) {
-               if (code >= amodule->llvm_code_start && code < amodule->llvm_code_end)
-                       return mono_arm_get_thumb_plt_entry (code);
-       }
+       if (is_thumb_code (amodule, code))
+               return mono_arm_get_thumb_plt_entry (code);
 #endif
 
 #ifdef MONO_ARCH_AOT_SUPPORTED
@@ -4639,16 +4652,15 @@ get_new_trampoline_from_page (int tramp_type)
                return code;
        }
        mono_aot_page_unlock ();
-       psize = mono_pagesize ();
        /* the trampoline template page is in the mscorlib module */
        image = mono_defaults.corlib;
        g_assert (image);
 
+       psize = MONO_AOT_TRAMP_PAGE_SIZE;
+
        amodule = image->aot_module;
        g_assert (amodule);
 
-       g_assert (amodule->info.tramp_page_size == psize);
-
        if (tramp_type == MONO_AOT_TRAMP_SPECIFIC)
                tpage = load_function (amodule, "specific_trampolines_page");
        else if (tramp_type == MONO_AOT_TRAMP_STATIC_RGCTX)
@@ -4730,7 +4742,7 @@ get_new_specific_trampoline_from_page (gpointer tramp, gpointer arg)
 
        code = get_new_trampoline_from_page (MONO_AOT_TRAMP_SPECIFIC);
 
-       data = (gpointer*)((char*)code - mono_pagesize ());
+       data = (gpointer*)((char*)code - MONO_AOT_TRAMP_PAGE_SIZE);
        data [0] = arg;
        data [1] = tramp;
        /*g_warning ("new trampoline at %p for data %p, tramp %p (stored at %p)", code, arg, tramp, data);*/
@@ -4746,7 +4758,7 @@ get_new_rgctx_trampoline_from_page (gpointer tramp, gpointer arg)
 
        code = get_new_trampoline_from_page (MONO_AOT_TRAMP_STATIC_RGCTX);
 
-       data = (gpointer*)((char*)code - mono_pagesize ());
+       data = (gpointer*)((char*)code - MONO_AOT_TRAMP_PAGE_SIZE);
        data [0] = arg;
        data [1] = tramp;
        /*g_warning ("new rgctx trampoline at %p for data %p, tramp %p (stored at %p)", code, arg, tramp, data);*/
@@ -4762,7 +4774,7 @@ get_new_imt_trampoline_from_page (gpointer arg)
 
        code = get_new_trampoline_from_page (MONO_AOT_TRAMP_IMT_THUNK);
 
-       data = (gpointer*)((char*)code - mono_pagesize ());
+       data = (gpointer*)((char*)code - MONO_AOT_TRAMP_PAGE_SIZE);
        data [0] = arg;
        /*g_warning ("new imt trampoline at %p for data %p, (stored at %p)", code, arg, data);*/
        return code;
@@ -4777,7 +4789,7 @@ get_new_gsharedvt_arg_trampoline_from_page (gpointer tramp, gpointer arg)
 
        code = get_new_trampoline_from_page (MONO_AOT_TRAMP_GSHAREDVT_ARG);
 
-       data = (gpointer*)((char*)code - mono_pagesize ());
+       data = (gpointer*)((char*)code - MONO_AOT_TRAMP_PAGE_SIZE);
        data [0] = arg;
        data [1] = tramp;
        /*g_warning ("new rgctx trampoline at %p for data %p, tramp %p (stored at %p)", code, arg, tramp, data);*/
index 13ef4ffcd7a9b280afa58fde8b0c7c48eef208fe..9ec39eb9e1b1818c4f407953195c7e7db0bb3a76 100644 (file)
@@ -206,4 +206,53 @@ class Tests
                d.Add ("key1", "banana");
                return d ["key1"] == "banana" ? 0 : 1;
        }
+
+       class NullableMethods {
+               [MethodImplAttribute (MethodImplOptions.NoInlining)]
+               public static bool GetHasValue<T>(Nullable<T> value) where T : struct {
+                       return value.HasValue;
+               }
+
+               [MethodImplAttribute (MethodImplOptions.NoInlining)]
+               public static T GetValue<T>(Nullable<T> value) where T : struct {
+                       return value.Value;
+               }
+       }
+
+       [Category ("DYNCALL")]
+       public static int test_0_dyncall_nullable () {
+               int? v;
+
+               v = 42;
+               NullableMethods.GetHasValue (v);
+               bool b = (bool)typeof (NullableMethods).GetMethod ("GetHasValue").MakeGenericMethod (new Type [] { typeof (int) }).Invoke (null, new object [] { v });
+               if (!b)
+                       return 1;
+               v = null;
+               b = (bool)typeof (NullableMethods).GetMethod ("GetHasValue").MakeGenericMethod (new Type [] { typeof (int) }).Invoke (null, new object [] { v });
+               if (b)
+                       return 2;
+
+               v = 42;
+               NullableMethods.GetValue (v);
+               var res = (int)typeof (NullableMethods).GetMethod ("GetValue").MakeGenericMethod (new Type [] { typeof (int) }).Invoke (null, new object [] { v });
+               if (res != 42)
+                       return 3;
+               return 0;
+       }
+
+       enum AnEnum {
+               A = 0,
+               B = 1
+       }
+
+       public static int test_0_enum_eq_comparer () {
+               var c = EqualityComparer<AnEnum>.Default;
+               return (!c.Equals (AnEnum.A, AnEnum.B) && c.Equals (AnEnum.A, AnEnum.A)) ? 0 : 1;
+       }
+
+       public static int test_0_enum_comparer () {
+               var c = Comparer<AnEnum>.Default;
+               return c.Compare (AnEnum.A, AnEnum.A);
+       }
 }
index ed62046b8a2cabdcab252e5020577d69e96e69cd..a5ccf787e73886fa0747e3d6feb2b0811bfc1e52 100644 (file)
@@ -704,6 +704,12 @@ class Tests
                return (int)(f1 / f2);
        }
 
+       public static int test_1_frem_r4 () {
+               float f1 = 7.0f;
+               float f2 = 2.0f;
+               return (int)(f1 % f2);
+       }
+
        public static int test_0_fcmp_eq_r4 () {
                float f1 = 1.0f;
                float f2 = 1.0f;
index 6214eec2fd7bde1f0f1d037f05b2254ede7e9069..dcecc4dfb05f191a8cd5d187d3d271ff44410c8f 100644 (file)
@@ -6535,12 +6535,21 @@ do_invoke_method (DebuggerTlsData *tls, Buffer *buf, InvokeData *invoke, guint8
                        return ERR_INVALID_ARGUMENT;
                }
                m = mono_object_get_virtual_method (this, m);
+               /* Transform this to the format the rest of the code expects it to be */
+               if (m->klass->valuetype) {
+                       this_buf = g_alloca (mono_class_instance_size (m->klass));
+                       memcpy (this_buf, mono_object_unbox (this), mono_class_instance_size (m->klass));
+               }
        } else if ((m->flags & METHOD_ATTRIBUTE_VIRTUAL) && !m->klass->valuetype && invoke->flags & INVOKE_FLAG_VIRTUAL) {
                if (!this) {
                        DEBUG_PRINTF (1, "[%p] Error: invoke with INVOKE_FLAG_VIRTUAL flag set without this argument.\n", (gpointer)GetCurrentThreadId ());
                        return ERR_INVALID_ARGUMENT;
                }
                m = mono_object_get_virtual_method (this, m);
+               if (m->klass->valuetype) {
+                       this_buf = g_alloca (mono_class_instance_size (m->klass));
+                       memcpy (this_buf, mono_object_unbox (this), mono_class_instance_size (m->klass));
+               }
        }
 
        DEBUG_PRINTF (1, "[%p] Invoking method '%s' on receiver '%s'.\n", (gpointer)GetCurrentThreadId (), mono_method_full_name (m, TRUE), this ? this->vtable->klass->name : "<null>");
index d10de0296914d607533b85762301deda555aa9c9..e93b9942285c8440a1de49f4b8a40e0137e2a661 100644 (file)
@@ -586,7 +586,11 @@ mono_arch_find_jit_info (MonoDomain *domain, MonoJitTlsData *jit_tls,
                        return TRUE;
                }
 
-               if (((guint64)(*lmf)->previous_lmf) & 1) {
+               if (((guint64)(*lmf)->previous_lmf) & 4) {
+                       MonoLMFTramp *ext = (MonoLMFTramp*)(*lmf);
+
+                       rip = (guint64)MONO_CONTEXT_GET_IP (ext->ctx);
+               } else if (((guint64)(*lmf)->previous_lmf) & 1) {
                        /* This LMF has the rip field set */
                        rip = (*lmf)->rip;
                } else if ((*lmf)->rsp == 0) {
@@ -610,29 +614,27 @@ mono_arch_find_jit_info (MonoDomain *domain, MonoJitTlsData *jit_tls,
                if (!ji)
                        return FALSE;
 
-               /* Adjust IP */
-               rip --;
-
                frame->ji = ji;
                frame->type = FRAME_TYPE_MANAGED_TO_NATIVE;
 
-               new_ctx->gregs [AMD64_RIP] = rip;
-               new_ctx->gregs [AMD64_RBP] = (*lmf)->rbp;
-               new_ctx->gregs [AMD64_RSP] = (*lmf)->rsp;
-
                if (((guint64)(*lmf)->previous_lmf) & 4) {
                        MonoLMFTramp *ext = (MonoLMFTramp*)(*lmf);
 
                        /* Trampoline frame */
-                       for (i = 0; i < AMD64_NREG; ++i) {
-                               if (AMD64_IS_CALLEE_SAVED_REG (i) && i != AMD64_RBP)
-                                       new_ctx->gregs [i] = ext->ctx->gregs [i];
-                       }
+                       for (i = 0; i < AMD64_NREG; ++i)
+                               new_ctx->gregs [i] = ext->ctx->gregs [i];
+                       /* Adjust IP */
+                       new_ctx->gregs [AMD64_RIP] --;
                } else {
                        /*
                         * The registers saved in the LMF will be restored using the normal unwind info,
                         * when the wrapper frame is processed.
                         */
+                       /* Adjust IP */
+                       rip --;
+                       new_ctx->gregs [AMD64_RIP] = rip;
+                       new_ctx->gregs [AMD64_RSP] = (*lmf)->rsp;
+                       new_ctx->gregs [AMD64_RBP] = (*lmf)->rbp;
                        for (i = 0; i < AMD64_NREG; ++i) {
                                if (AMD64_IS_CALLEE_SAVED_REG (i) && i != AMD64_RBP)
                                        new_ctx->gregs [i] = 0;
@@ -736,7 +738,7 @@ mono_arch_ip_from_context (void *sigctx)
        return ((CONTEXT*)sigctx)->Rip;
 #else
        MonoContext *ctx = sigctx;
-       return (gpointer)ctx->rip;
+       return (gpointer)ctx->gregs [AMD64_RIP];
 #endif 
 }
 
@@ -976,7 +978,7 @@ mono_arch_notify_pending_exc (MonoThreadInfo *info)
                /* Initial LMF */
                return;
 
-       if ((guint64)lmf->previous_lmf & 1)
+       if ((guint64)lmf->previous_lmf & 5)
                /* Already hijacked or trampoline LMF entry */
                return;
 
index b9534ae395bc7604c1b9182bb0a32075e2915a6a..2a4aae744e1fce2678c83e74d4c3d1f47d89c76d 100644 (file)
@@ -12,6 +12,9 @@
 #include <glib.h>
 #include <signal.h>
 #include <string.h>
+#ifdef HAVE_UCONTEXT_H
+#include <ucontext.h>
+#endif
 
 #include <mono/metadata/abi-details.h>
 #include <mono/arch/x86/x86-codegen.h>
index e06be608cf5366c5d5b5a710a7c4c45e042c9098..131a9c63a5ce1b69d7cfe3ffb0f9450325c9817a 100644 (file)
@@ -2795,6 +2795,27 @@ class Tests
                }
                return 1;
        }
+
+       static bool finally_called = false;
+
+       static void regress_30472 (int a, int b) {
+                       checked {
+                               try {
+                                       int sum = a + b;
+                               } finally {
+                                       finally_called = true;
+                               }
+            }
+               }
+
+       public static int test_0_regress_30472 () {
+               finally_called = false;
+               try {
+                   regress_30472 (Int32.MaxValue - 1, 2);
+               } catch (Exception ex) {
+               }
+               return finally_called ? 0 : 1;
+       }
 }
 
 #if !MOBILE
index ef3d57a92088ee3f3a0a3f2d608bc20757b2ae2c..ce8ae5a444a8bfdd9626a9d5689f60ce4e9e035a 100644 (file)
@@ -3689,7 +3689,11 @@ static void
 emit_class_init (MonoCompile *cfg, MonoClass *klass, MonoBasicBlock **out_bblock)
 {
        /* This could be used as a fallback if needed */
-       //emit_generic_class_init (cfg, klass, out_bblock);
+       if (cfg->compile_aot) {
+               /* With the overhead of plt entries, the inline version is comparable in size/speed */
+               emit_generic_class_init (cfg, klass, out_bblock);
+               return;
+       }
 
        *out_bblock = cfg->cbb;
 
@@ -5546,10 +5550,12 @@ emit_array_unsafe_access (MonoCompile *cfg, MonoMethodSignature *fsig, MonoInst
 }
 
 static gboolean
-is_unsafe_mov_compatible (MonoClass *param_klass, MonoClass *return_klass)
+is_unsafe_mov_compatible (MonoCompile *cfg, MonoClass *param_klass, MonoClass *return_klass)
 {
        uint32_t align;
 
+       param_klass = mono_class_from_mono_type (mini_get_underlying_type (cfg, &param_klass->byval_arg));
+
        //Only allow for valuetypes
        if (!param_klass->valuetype || !return_klass->valuetype)
                return FALSE;
@@ -5580,11 +5586,11 @@ emit_array_unsafe_mov (MonoCompile *cfg, MonoMethodSignature *fsig, MonoInst **a
        MonoClass *return_klass = mono_class_from_mono_type (fsig->ret);
 
        //Valuetypes that are semantically equivalent
-       if (is_unsafe_mov_compatible (param_klass, return_klass))
+       if (is_unsafe_mov_compatible (cfg, param_klass, return_klass))
                return args [0];
 
        //Arrays of valuetypes that are semantically equivalent
-       if (param_klass->rank == 1 && return_klass->rank == 1 && is_unsafe_mov_compatible (param_klass->element_class, return_klass->element_class))
+       if (param_klass->rank == 1 && return_klass->rank == 1 && is_unsafe_mov_compatible (cfg, param_klass->element_class, return_klass->element_class))
                return args [0];
 
        return NULL;
@@ -8190,12 +8196,13 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
                         * Backward branches are handled at the end of method-to-ir ().
                         */
                        gboolean intr_loc = ip == header->code || (!cfg->cbb->last_ins && cfg->header->num_clauses);
+                       gboolean sym_seq_point = sym_seq_points && mono_bitset_test_fast (seq_point_locs, ip - header->code);
 
                        /* Avoid sequence points on empty IL like .volatile */
                        // FIXME: Enable this
                        //if (!(cfg->cbb->last_ins && cfg->cbb->last_ins->opcode == OP_SEQ_POINT)) {
                        NEW_SEQ_POINT (cfg, ins, ip - header->code, intr_loc);
-                       if (sp != stack_start)
+                       if ((sp != stack_start) && !sym_seq_point)
                                ins->flags |= MONO_INST_NONEMPTY_STACK;
                        MONO_ADD_INS (cfg->cbb, ins);
 
index c1332ec3bc0272180edf7a4c8934975d356fcc98..744b42be16f8e8ebc3785dc684a64d5a2f980376 100644 (file)
@@ -7851,6 +7851,39 @@ get_delegate_invoke_impl (gboolean has_target, guint32 param_count, guint32 *cod
        return start;
 }
 
+#define MAX_VIRTUAL_DELEGATE_OFFSET 32
+
+static gpointer
+get_delegate_virtual_invoke_impl (gboolean load_imt_reg, int offset, guint32 *code_len)
+{
+       guint8 *code, *start;
+       int size = 20;
+
+       if (offset / sizeof (gpointer) > MAX_VIRTUAL_DELEGATE_OFFSET)
+               return NULL;
+
+       start = code = mono_global_codeman_reserve (size);
+
+       /* Replace the this argument with the target */
+       amd64_mov_reg_reg (code, AMD64_RAX, AMD64_ARG_REG1, 8);
+       amd64_mov_reg_membase (code, AMD64_ARG_REG1, AMD64_RAX, MONO_STRUCT_OFFSET (MonoDelegate, target), 8);
+
+       if (load_imt_reg) {
+               /* Load the IMT reg */
+               amd64_mov_reg_membase (code, MONO_ARCH_IMT_REG, AMD64_RAX, MONO_STRUCT_OFFSET (MonoDelegate, method), 8);
+       }
+
+       /* Load the vtable */
+       amd64_mov_reg_membase (code, AMD64_RAX, AMD64_ARG_REG1, MONO_STRUCT_OFFSET (MonoObject, vtable), 8);
+       amd64_jump_membase (code, AMD64_RAX, offset);
+       mono_profiler_code_buffer_new (start, code - start, MONO_PROFILER_CODE_BUFFER_DELEGATE_INVOKE, NULL);
+
+       if (code_len)
+               *code_len = code - start;
+
+       return start;
+}
+
 /*
  * mono_arch_get_delegate_invoke_impls:
  *
@@ -7876,6 +7909,18 @@ mono_arch_get_delegate_invoke_impls (void)
                g_free (tramp_name);
        }
 
+       for (i = 0; i < MAX_VIRTUAL_DELEGATE_OFFSET; ++i) {
+               code = get_delegate_virtual_invoke_impl (TRUE, i * SIZEOF_VOID_P, &code_len);
+               tramp_name = g_strdup_printf ("delegate_virtual_invoke_imt_%d", i);
+               res = g_slist_prepend (res, mono_tramp_info_create (tramp_name, code, code_len, NULL, NULL));
+               g_free (tramp_name);
+
+               code = get_delegate_virtual_invoke_impl (FALSE, i * SIZEOF_VOID_P, &code_len);
+               tramp_name = g_strdup_printf ("delegate_virtual_invoke_%d", i);
+               res = g_slist_prepend (res, mono_tramp_info_create (tramp_name, code, code_len, NULL, NULL));
+               g_free (tramp_name);
+       }
+
        return res;
 }
 
@@ -7937,26 +7982,7 @@ mono_arch_get_delegate_invoke_impl (MonoMethodSignature *sig, gboolean has_targe
 gpointer
 mono_arch_get_delegate_virtual_invoke_impl (MonoMethodSignature *sig, MonoMethod *method, int offset, gboolean load_imt_reg)
 {
-       guint8 *code, *start;
-       int size = 20;
-
-       start = code = mono_global_codeman_reserve (size);
-
-       /* Replace the this argument with the target */
-       amd64_mov_reg_reg (code, AMD64_RAX, AMD64_ARG_REG1, 8);
-       amd64_mov_reg_membase (code, AMD64_ARG_REG1, AMD64_RAX, MONO_STRUCT_OFFSET (MonoDelegate, target), 8);
-
-       if (load_imt_reg) {
-               /* Load the IMT reg */
-               amd64_mov_reg_membase (code, MONO_ARCH_IMT_REG, AMD64_RAX, MONO_STRUCT_OFFSET (MonoDelegate, method), 8);
-       }
-
-       /* Load the vtable */
-       amd64_mov_reg_membase (code, AMD64_RAX, AMD64_ARG_REG1, MONO_STRUCT_OFFSET (MonoObject, vtable), 8);
-       amd64_jump_membase (code, AMD64_RAX, offset);
-       mono_profiler_code_buffer_new (start, code - start, MONO_PROFILER_CODE_BUFFER_DELEGATE_INVOKE, NULL);
-
-       return start;
+       return get_delegate_virtual_invoke_impl (load_imt_reg, offset, NULL);
 }
 
 void
index 5bdbfbd6462f0814657205d51cfd120036e911c1..3588a31e86aa050f20605ebecc15ac256d689b62 100644 (file)
@@ -171,7 +171,8 @@ struct MonoLMF {
         * the caller ip is saved.
         * If the second lowest bit is set, then this is a MonoLMFExt structure, and
         * the other fields are not valid.
-        * If the third lowest bit is set, then this is a MonoLMFTramp structure.
+        * If the third lowest bit is set, then this is a MonoLMFTramp structure, and
+        * the 'rbp' field is not valid.
         */
        gpointer    previous_lmf;
 #if defined(__default_codegen__) || defined(HOST_WIN32)
index 547140a274b3707227fc7683acc242fc4e126c6b..0bdec210868ae04a6913482a461efc4b5ddaa302 100644 (file)
@@ -2863,7 +2863,23 @@ mono_arch_start_dyn_call (MonoDynCallInfo *info, gpointer **args, guint8 *ret, g
                                p->regs [slot] = (mgreg_t)*arg;
                                break;
                        } else {
-                               /* Fall though */
+                               if (t->type == MONO_TYPE_GENERICINST && mono_class_is_nullable (mono_class_from_mono_type (t))) {
+                                       MonoClass *klass = mono_class_from_mono_type (t);
+                                       guint8 *nullable_buf;
+                                       int size;
+
+                                       size = mono_class_value_size (klass, NULL);
+                                       nullable_buf = g_alloca (size);
+                                       g_assert (nullable_buf);
+
+                                       /* The argument pointed to by arg is either a boxed vtype or null */
+                                       mono_nullable_init (nullable_buf, (MonoObject*)arg, klass);
+
+                                       arg = (gpointer*)nullable_buf;
+                                       /* Fall though */
+                               } else {
+                                       /* Fall though */
+                               }
                        }
                case MONO_TYPE_VALUETYPE:
                        g_assert (ainfo->storage == RegTypeStructByVal);
index e1914885b60d9622b911459bfb7dba53d8284e75..4fde10b791fabbd369962c611d37f097cb6000d4 100644 (file)
@@ -702,7 +702,7 @@ mono_print_ins_index (int i, MonoInst *ins)
                break;
        case OP_IL_SEQ_POINT:
        case OP_SEQ_POINT:
-               printf (" il: %x", (int)ins->inst_imm);
+               printf (" il: 0x%x%s", (int)ins->inst_imm, ins->flags & MONO_INST_NONEMPTY_STACK ? ", nonempty-stack" : "");
                break;
        default:
                break;
index fd7e005a82e5c6937678b93c3fc485c830fd061e..6e04ca2e22c6c314c4f5882b33e85401af1dcae0 100644 (file)
@@ -2955,14 +2955,21 @@ get_shared_type (MonoType *t, MonoType *type)
                k = mono_class_inflate_generic_class (gclass->container_class, &context);
 
                return get_shared_gparam (t, &k->byval_arg);
+       } else if (MONO_TYPE_ISSTRUCT (type)) {
+               return type;
        }
 
-       g_assert (!type->byref && (((type->type >= MONO_TYPE_BOOLEAN) && (type->type <= MONO_TYPE_R8)) || (type->type == MONO_TYPE_I) || (type->type == MONO_TYPE_U) || (type->type == MONO_TYPE_VALUETYPE && type->data.klass->enumtype)));
-
        /* Create a type variable with a constraint which encodes which types can match it */
        ttype = type->type;
-       if (type->type == MONO_TYPE_VALUETYPE)
+       if (type->type == MONO_TYPE_VALUETYPE) {
                ttype = mono_class_enum_basetype (type->data.klass)->type;
+       } else if (MONO_TYPE_IS_REFERENCE (type)) {
+               ttype = MONO_TYPE_OBJECT;
+       } else if (type->type == MONO_TYPE_VAR || type->type == MONO_TYPE_MVAR) {
+               if (type->data.generic_param->gshared_constraint)
+                       return get_shared_gparam (t, type->data.generic_param->gshared_constraint);
+               ttype = MONO_TYPE_OBJECT;
+       }
 
        {
                MonoType t2;
@@ -2992,18 +2999,11 @@ get_shared_inst (MonoGenericInst *inst, MonoGenericInst *shared_inst, MonoGeneri
 
        type_argv = g_new0 (MonoType*, inst->type_argc);
        for (i = 0; i < inst->type_argc; ++i) {
-               if (all_vt) {
+               if (all_vt || gsharedvt) {
                        type_argv [i] = get_gsharedvt_type (shared_inst->type_argv [i]);
-               } else if ((MONO_TYPE_IS_REFERENCE (inst->type_argv [i]) || inst->type_argv [i]->type == MONO_TYPE_VAR || inst->type_argv [i]->type == MONO_TYPE_MVAR)) {
-                       g_assert (shared_inst);
-                       type_argv [i] = get_shared_gparam (shared_inst->type_argv [i], &mono_defaults.object_class->byval_arg);
-               } else if (partial) {
+               } else {
                        /* These types match the ones in generic_inst_is_sharable () */
                        type_argv [i] = get_shared_type (shared_inst->type_argv [i], inst->type_argv [i]);
-               } else if (gsharedvt) {
-                       type_argv [i] = get_gsharedvt_type (shared_inst->type_argv [i]);
-               } else {
-                       type_argv [i] = inst->type_argv [i];
                }
        }
 
@@ -3073,6 +3073,8 @@ mini_get_shared_method_full (MonoMethod *method, gboolean all_vt, gboolean is_gs
        res = mono_class_inflate_generic_method_checked (declaring_method, &shared_context, &error);
        g_assert (mono_error_ok (&error)); /* FIXME don't swallow the error */
 
+       //printf ("%s\n", mono_method_full_name (res, 1));
+
        return res;
 }
 
index 3b0c2594d9437d4d1d113a4d7eb78cfb7085b633..2667eac00f99831b2a9a363474ad847c405da794 100644 (file)
@@ -2709,7 +2709,7 @@ process_bb (EmitContext *ctx, MonoBasicBlock *bb)
                emit_dbg_loc (ctx, builder, ins->cil_code);
 
                nins ++;
-               if (nins > 5000 && builder == starting_builder) {
+               if (nins > 3000 && builder == starting_builder) {
                        /* some steps in llc are non-linear in the size of basic blocks, see #5714 */
                        LLVM_FAILURE (ctx, "basic block too long");
                }
index 0405b1a69d93c370af91f2085d534c1aafa0e4ef..33a055fd76ee64f856bcbfcf74de199604fea534 100644 (file)
@@ -1178,7 +1178,6 @@ mono_patch_info_hash (gconstpointer data)
        case MONO_PATCH_INFO_METHOD:
        case MONO_PATCH_INFO_METHOD_JUMP:
        case MONO_PATCH_INFO_IMAGE:
-       case MONO_PATCH_INFO_JIT_ICALL_ADDR:
        case MONO_PATCH_INFO_ICALL_ADDR:
        case MONO_PATCH_INFO_FIELD:
        case MONO_PATCH_INFO_SFLDA:
@@ -1224,6 +1223,8 @@ mono_patch_info_hash (gconstpointer data)
 
                return (ji->type << 8) | (gssize)info->klass | (gssize)info->method;
        }
+       case MONO_PATCH_INFO_JIT_ICALL_ADDR:
+               return (ji->type << 8) | g_str_hash (ji->data.target);
        default:
                printf ("info type: %d\n", ji->type);
                mono_print_ji (ji); printf ("\n");
@@ -1283,6 +1284,10 @@ mono_patch_info_equal (gconstpointer ka, gconstpointer kb)
                return ji1->data.index == ji2->data.index;
        case MONO_PATCH_INFO_VIRT_METHOD:
                return ji1->data.virt_method->klass == ji2->data.virt_method->klass && ji1->data.virt_method->method == ji2->data.virt_method->method;
+       case MONO_PATCH_INFO_JIT_ICALL_ADDR:
+               if (ji1->data.target == ji2->data.target)
+                       return 1;
+               return strcmp (ji1->data.target, ji2->data.target) == 0 ? 1 : 0;
        default:
                if (ji1->data.target != ji2->data.target)
                        return 0;
@@ -2263,7 +2268,7 @@ mono_jit_runtime_invoke (MonoMethod *method, void *obj, void **params, MonoObjec
                        for (i = 0; i < sig->param_count; ++i) {
                                MonoType *t = sig->params [i];
 
-                               if (t->type == MONO_TYPE_GENERICINST && mono_class_is_nullable (mono_class_from_mono_type (t)))
+                               if (t->byref && t->type == MONO_TYPE_GENERICINST && mono_class_is_nullable (mono_class_from_mono_type (t)))
                                        supported = FALSE;
                        }
 
@@ -2628,10 +2633,6 @@ mono_get_delegate_virtual_invoke_impl (MonoMethodSignature *sig, MonoMethod *met
        if (!method)
                return NULL;
 
-       /* FIXME Support more cases */
-       if (mono_aot_only)
-               return NULL;
-
        if (MONO_TYPE_ISSTRUCT (sig->ret))
                return NULL;
 
@@ -2669,7 +2670,17 @@ mono_get_delegate_virtual_invoke_impl (MonoMethodSignature *sig, MonoMethod *met
        if (cache [idx])
                return cache [idx];
 
-       return cache [idx] = mono_arch_get_delegate_virtual_invoke_impl (sig, method, offset, load_imt_reg);
+       /* FIXME Support more cases */
+       if (mono_aot_only) {
+               char tramp_name [256];
+
+               sprintf (tramp_name, "delegate_virtual_invoke%s_%d", load_imt_reg ? "_imt" : "", offset / SIZEOF_VOID_P);
+               cache [idx] = mono_aot_get_trampoline (tramp_name);
+               g_assert (cache [idx]);
+       } else {
+               cache [idx] = mono_arch_get_delegate_virtual_invoke_impl (sig, method, offset, load_imt_reg);
+       }
+       return cache [idx];
 }
 
 static gpointer
@@ -3311,6 +3322,7 @@ register_icalls (void)
 #ifdef MONO_ARCH_EMULATE_FREM
 #if defined(__default_codegen__)
        register_opcode_emulation (OP_FREM, "__emul_frem", "double double double", fmod, "fmod", FALSE);
+       register_opcode_emulation (OP_RREM, "__emul_rrem", "float float float", fmodf, "fmodf", FALSE);
 #elif defined(__native_client_codegen__)
        register_opcode_emulation (OP_FREM, "__emul_frem", "double double double", mono_fmod, "mono_fmod", FALSE);
 #endif
index 085f56141f9063ad49d1b5f9acdf379efc724511..7de1cae2345af807baa9deab34d9437552fef163 100644 (file)
@@ -1822,7 +1822,9 @@ mini_get_nullified_class_init_trampoline (void)
                MonoTrampInfo *info;
 
                if (mono_aot_only) {
-                       tramp = mono_aot_get_trampoline ("nullified_class_init_trampoline");
+                       /* Not used */
+                       g_assert_not_reached ();
+                       tramp = NULL;
                } else {
                        tramp = mono_arch_get_nullified_class_init_trampoline (&info);
                        mono_tramp_info_register (info);
index 53e5d6fbbd100281e84f66b44ab3ee564b0ac1b2..b53f0a6bccf2d8fe72bc133dcb9ec66e6e163812 100644 (file)
@@ -6161,6 +6161,42 @@ get_delegate_invoke_impl (gboolean has_target, guint32 param_count, guint32 *cod
        return start;
 }
 
+#define MAX_VIRTUAL_DELEGATE_OFFSET 32
+
+static gpointer
+get_delegate_virtual_invoke_impl (gboolean load_imt_reg, int offset, guint32 *code_size)
+{
+       guint8 *code, *start;
+       int size = 24;
+
+       /*
+        * The stack contains:
+        * <delegate>
+        * <return addr>
+        */
+       start = code = mono_global_codeman_reserve (size);
+
+       /* Replace the this argument with the target */
+       x86_mov_reg_membase (code, X86_EAX, X86_ESP, 4, 4);
+       x86_mov_reg_membase (code, X86_ECX, X86_EAX, MONO_STRUCT_OFFSET (MonoDelegate, target), 4);
+       x86_mov_membase_reg (code, X86_ESP, 4, X86_ECX, 4);
+
+       if (load_imt_reg) {
+               /* Load the IMT reg */
+               x86_mov_reg_membase (code, MONO_ARCH_IMT_REG, X86_EAX, MONO_STRUCT_OFFSET (MonoDelegate, method), 4);
+       }
+
+       /* Load the vtable */
+       x86_mov_reg_membase (code, X86_EAX, X86_ECX, MONO_STRUCT_OFFSET (MonoObject, vtable), 4);
+       x86_jump_membase (code, X86_EAX, offset);
+       mono_profiler_code_buffer_new (start, code - start, MONO_PROFILER_CODE_BUFFER_DELEGATE_INVOKE, NULL);
+
+       if (code_size)
+               *code_size = code - start;
+
+       return start;
+}
+
 GSList*
 mono_arch_get_delegate_invoke_impls (void)
 {
@@ -6180,6 +6216,18 @@ mono_arch_get_delegate_invoke_impls (void)
                g_free (tramp_name);
        }
 
+       for (i = 0; i < MAX_VIRTUAL_DELEGATE_OFFSET; ++i) {
+               code = get_delegate_virtual_invoke_impl (TRUE, i * SIZEOF_VOID_P, &code_len);
+               tramp_name = g_strdup_printf ("delegate_virtual_invoke_imt_%d", i);
+               res = g_slist_prepend (res, mono_tramp_info_create (tramp_name, code, code_len, NULL, NULL));
+               g_free (tramp_name);
+
+               code = get_delegate_virtual_invoke_impl (FALSE, i * SIZEOF_VOID_P, &code_len);
+               tramp_name = g_strdup_printf ("delegate_virtual_invoke_%d", i);
+               res = g_slist_prepend (res, mono_tramp_info_create (tramp_name, code, code_len, NULL, NULL));
+               g_free (tramp_name);
+       }
+
        return res;
 }
 
@@ -6245,32 +6293,7 @@ mono_arch_get_delegate_invoke_impl (MonoMethodSignature *sig, gboolean has_targe
 gpointer
 mono_arch_get_delegate_virtual_invoke_impl (MonoMethodSignature *sig, MonoMethod *method, int offset, gboolean load_imt_reg)
 {
-       guint8 *code, *start;
-       int size = 24;
-
-       /*
-        * The stack contains:
-        * <delegate>
-        * <return addr>
-        */
-       start = code = mono_global_codeman_reserve (size);
-
-       /* Replace the this argument with the target */
-       x86_mov_reg_membase (code, X86_EAX, X86_ESP, 4, 4);
-       x86_mov_reg_membase (code, X86_ECX, X86_EAX, MONO_STRUCT_OFFSET (MonoDelegate, target), 4);
-       x86_mov_membase_reg (code, X86_ESP, 4, X86_ECX, 4);
-
-       if (load_imt_reg) {
-               /* Load the IMT reg */
-               x86_mov_reg_membase (code, MONO_ARCH_IMT_REG, X86_EAX, MONO_STRUCT_OFFSET (MonoDelegate, method), 4);
-       }
-
-       /* Load the vtable */
-       x86_mov_reg_membase (code, X86_EAX, X86_ECX, MONO_STRUCT_OFFSET (MonoObject, vtable), 4);
-       x86_jump_membase (code, X86_EAX, offset);
-       mono_profiler_code_buffer_new (start, code - start, MONO_PROFILER_CODE_BUFFER_DELEGATE_INVOKE, NULL);
-
-       return start;
+       return get_delegate_virtual_invoke_impl (load_imt_reg, offset, NULL);
 }
 
 mgreg_t
index 8889c976a06c693f1ce35b774a83ad18b65a3992..be741a249066a9f9e0b7b098fcee2776a681e4c4 100644 (file)
@@ -3047,7 +3047,7 @@ static void
 mono_create_gc_safepoint (MonoCompile *cfg, MonoBasicBlock *bblock)
 {
        MonoInst *poll_addr, *ins;
-       if (cfg->verbose_level)
+       if (cfg->verbose_level > 1)
                printf ("ADDING SAFE POINT TO BB %d\n", bblock->block_num);
 
 #if defined(__native_client_codegen__)
@@ -3062,9 +3062,16 @@ mono_create_gc_safepoint (MonoCompile *cfg, MonoBasicBlock *bblock)
         if (bblock->flags & BB_EXCEPTION_HANDLER) {
                MonoInst *eh_op = bblock->code;
 
-               // we only skip the ops that start EH blocks.
-               if (eh_op && eh_op->opcode != OP_START_HANDLER && eh_op->opcode != OP_GET_EX_OBJ)
+               if (eh_op && eh_op->opcode != OP_START_HANDLER && eh_op->opcode != OP_GET_EX_OBJ) {
                        eh_op = NULL;
+               } else {
+                       MonoInst *next_eh_op = eh_op ? eh_op->next : NULL;
+                       // skip all EH relateds ops
+                       while (next_eh_op && (next_eh_op->opcode == OP_START_HANDLER || next_eh_op->opcode == OP_GET_EX_OBJ)) {
+                               eh_op = next_eh_op;
+                               next_eh_op = eh_op->next;
+                       }
+               }
 
                mono_bblock_insert_after_ins (bblock, eh_op, poll_addr);
                mono_bblock_insert_after_ins (bblock, poll_addr, ins);
@@ -3092,13 +3099,19 @@ mono_insert_safepoints (MonoCompile *cfg)
 {
        MonoBasicBlock *bb;
 
-       if (cfg->verbose_level)
+       if (cfg->verbose_level > 1)
                printf ("INSERTING SAFEPOINTS\n");
+       if (cfg->verbose_level > 2)
+               mono_print_code (cfg, "BEFORE SAFEPOINTS");
 
        for (bb = cfg->bb_entry; bb; bb = bb->next_bb) {
                if (bb->loop_body_start || bb == cfg->bb_entry || bb->flags & BB_EXCEPTION_HANDLER)
                        mono_create_gc_safepoint (cfg, bb);
        }
+
+       if (cfg->verbose_level > 2)
+               mono_print_code (cfg, "AFTER SAFEPOINTS");
+
 }
 
 #else
@@ -3149,21 +3162,30 @@ mini_method_compile (MonoMethod *method, guint32 opts, MonoDomain *domain, JitFl
        if (MONO_METHOD_COMPILE_BEGIN_ENABLED ())
                MONO_PROBE_METHOD_COMPILE_BEGIN (method);
 
+       gsharedvt_method = is_gsharedvt_method (method);
+
        /*
         * In AOT mode, method can be the following:
-        * - the generic method definition. In this case, we are compiling the fully shared
-        *   version of the method, i.e. the version where all the type parameters are
-        *   reference types.
         * - a gsharedvt method.
-        * - a method inflated with type parameters. This is for partial sharing.
+        * - a method inflated with type parameters. This is for ref/partial sharing.
         * - a method inflated with concrete types.
         */
-       if (compile_aot)
-               try_generic_shared = mono_class_generic_sharing_enabled (method->klass) &&
-                       (opts & MONO_OPT_GSHARED) && ((method->is_generic || method->klass->generic_container) || (!method->klass->generic_class && mono_method_is_generic_sharable_full (method, TRUE, FALSE, FALSE)));
-       else
+       if (compile_aot) {
+               if (is_open_method (method)) {
+                       try_generic_shared = TRUE;
+                       method_is_gshared = TRUE;
+               } else {
+                       try_generic_shared = FALSE;
+               }
+               g_assert (opts & MONO_OPT_GSHARED);
+       } else {
                try_generic_shared = mono_class_generic_sharing_enabled (method->klass) &&
                        (opts & MONO_OPT_GSHARED) && mono_method_is_generic_sharable (method, FALSE);
+               if (mini_is_gsharedvt_sharable_method (method)) {
+                       if (!mono_debug_count ())
+                               try_generic_shared = FALSE;
+               }
+       }
 
        /*
        if (try_generic_shared && !mono_debug_count ())
@@ -3177,21 +3199,6 @@ mini_method_compile (MonoMethod *method, guint32 opts, MonoDomain *domain, JitFl
                        mono_stats.generics_unsharable_methods++;
        }
 
-       if (mini_is_gsharedvt_sharable_method (method)) {
-               if (!mono_debug_count ())
-                       try_generic_shared = FALSE;
-               if (compile_aot)
-                       try_generic_shared = FALSE;
-       }
-
-       gsharedvt_method = is_gsharedvt_method (method);
-       if (gsharedvt_method || (compile_aot && is_open_method (method))) {
-               /* We are AOTing a gshared method directly */
-               method_is_gshared = TRUE;
-               g_assert (compile_aot);
-               try_generic_shared = TRUE;
-       }
-
 #ifdef ENABLE_LLVM
        try_llvm = mono_use_llvm || llvm;
 #endif
index 2cc6a56e550242c13d8ca26b893fe120ca080e76..61876da9ace7fa908df8ebe848d66e7662596d9f 100644 (file)
 #endif
 
 /* Version number of the AOT file format */
-#define MONO_AOT_FILE_VERSION 116
+#define MONO_AOT_FILE_VERSION 117
 
 //TODO: This is x86/amd64 specific.
 #define mono_simd_shuffle_mask(a,b,c,d) ((a) | ((b) << 2) | ((c) << 4) | ((d) << 6))
 
 #define MONO_TYPE_IS_PRIMITIVE(t) ((!(t)->byref && ((((t)->type >= MONO_TYPE_BOOLEAN && (t)->type <= MONO_TYPE_R8) || ((t)->type >= MONO_TYPE_I && (t)->type <= MONO_TYPE_U)))))
 
+#define MONO_AOT_TRAMP_PAGE_SIZE 16384
+
 /* Constants used to encode different types of methods in AOT */
 enum {
        MONO_AOT_METHODREF_MIN = 240,
@@ -174,6 +176,7 @@ typedef enum {
        MONO_AOT_FILE_FLAG_WITH_LLVM = 1,
        MONO_AOT_FILE_FLAG_FULL_AOT = 2,
        MONO_AOT_FILE_FLAG_DEBUG = 4,
+       MONO_AOT_FILE_FLAG_LLVM_THUMB = 8,
 } MonoAotFileFlags;
 
 /* This structure is stored in the AOT file */
@@ -226,10 +229,6 @@ typedef struct MonoAotFileInfo
        gpointer static_rgctx_trampolines;
        gpointer imt_thunks;
        gpointer gsharedvt_arg_trampolines;
-       /*
-        * The end of LLVM generated thumb code, or NULL.
-        */
-       gpointer thumb_end;
        /* In static mode, points to a table of global symbols for trampolines etc */
        gpointer globals;
        /* Points to a string containing the assembly name*/
index b2b511f0cb49347eefabf908987a7539aceaecc8..e48696334c00629dda6476ec595866a5d32ef35e 100644 (file)
@@ -98,7 +98,8 @@ mono_save_seq_point_info (MonoCompile *cfg)
                                last = ins;
                        }
 
-                       if (bb->last_ins && bb->last_ins->opcode == OP_ENDFINALLY && bb->seq_points) {
+                       /* The second case handles endfinally opcodes which are in a separate bb by themselves */
+                       if ((bb->last_ins && bb->last_ins->opcode == OP_ENDFINALLY && bb->seq_points) || (bb->out_count == 1 && bb->out_bb [0]->code && bb->out_bb [0]->code->opcode == OP_ENDFINALLY)) {
                                MonoBasicBlock *bb2;
                                MonoInst *endfinally_seq_point = NULL;
 
index 78bcad3106dbfe284e00169417f9155796164d59..4be828414da66c2fdd47259d72db0fc4ae9060ee 100644 (file)
@@ -497,6 +497,16 @@ mono_arch_create_generic_trampoline (MonoTrampolineType tramp_type, MonoTrampInf
                        /* RAX is already saved */
                        amd64_mov_reg_membase (code, AMD64_RAX, AMD64_RBP, rbp_offset, sizeof(mgreg_t));
                        amd64_mov_membase_reg (code, AMD64_RBP, saved_regs_offset + (i * sizeof(mgreg_t)), AMD64_RAX, sizeof(mgreg_t));
+               } else if (i == AMD64_RIP) {
+                       if (has_caller)
+                               amd64_mov_reg_membase (code, AMD64_R11, AMD64_RBP, 8, sizeof(gpointer));
+                       else
+                               amd64_mov_reg_imm (code, AMD64_R11, 0);
+                       amd64_mov_membase_reg (code, AMD64_RBP, saved_regs_offset + (i * sizeof(mgreg_t)), AMD64_R11, sizeof(mgreg_t));
+               } else if (i == AMD64_RSP) {
+                       amd64_mov_reg_reg (code, AMD64_R11, AMD64_RSP, sizeof(mgreg_t));
+                       amd64_alu_reg_imm (code, X86_ADD, AMD64_R11, framesize + 16);
+                       amd64_mov_membase_reg (code, AMD64_RBP, saved_regs_offset + (i * sizeof(mgreg_t)), AMD64_R11, sizeof(mgreg_t));
                } else if (i != AMD64_R11) {
                        amd64_mov_membase_reg (code, AMD64_RBP, saved_regs_offset + (i * sizeof(mgreg_t)), i, sizeof(mgreg_t));
                } else {
@@ -590,14 +600,11 @@ mono_arch_create_generic_trampoline (MonoTrampolineType tramp_type, MonoTrampInf
        else
                amd64_mov_reg_imm (code, AMD64_R11, 0);
        amd64_mov_membase_reg (code, AMD64_RBP, lmf_offset + MONO_STRUCT_OFFSET (MonoLMF, rip), AMD64_R11, sizeof(mgreg_t));
-       /* Save fp */
-       amd64_mov_reg_membase (code, AMD64_R11, AMD64_RSP, framesize, sizeof(mgreg_t));
-       amd64_mov_membase_reg (code, AMD64_RBP, lmf_offset + MONO_STRUCT_OFFSET (MonoLMF, rbp), AMD64_R11, sizeof(mgreg_t));
        /* Save sp */
        amd64_mov_reg_reg (code, AMD64_R11, AMD64_RSP, sizeof(mgreg_t));
        amd64_alu_reg_imm (code, X86_ADD, AMD64_R11, framesize + 16);
        amd64_mov_membase_reg (code, AMD64_RBP, lmf_offset + MONO_STRUCT_OFFSET (MonoLMF, rsp), AMD64_R11, sizeof(mgreg_t));
-       /* Save pointer to registers */
+       /* Save pointer to context */
        amd64_lea_membase (code, AMD64_R11, AMD64_RBP, ctx_offset);
        amd64_mov_membase_reg (code, AMD64_RBP, lmf_offset + MONO_STRUCT_OFFSET (MonoLMFTramp, ctx), AMD64_R11, sizeof(mgreg_t));
 
index c7f0539b7e3273f44f2694730b557999925d8665..9690f6297bd6c2fdc5585e28e6bedcafeee2e360 100644 (file)
@@ -1,8 +1,9 @@
 /*
  * decode.c: mprof-report program source: decode and analyze the log profiler data
  *
- * Author:
+ * Authors:
  *   Paolo Molaro (lupus@ximian.com)
+ *   Alex Rønne Petersen (alexrp@xamarin.com)
  *
  * Copyright 2010 Novell, Inc (http://www.novell.com)
  */
index 1d3d6651ed7fd4706745b682d2914d0edb1798cb..809002978597d0859d1fa31e87926561875a6eb8 100644 (file)
@@ -1,8 +1,9 @@
 /*
  * proflog.c: mono log profiler
  *
- * Author:
+ * Authors:
  *   Paolo Molaro (lupus@ximian.com)
+ *   Alex Rønne Petersen (alexrp@xamarin.com)
  *
  * Copyright 2010 Novell, Inc (http://www.novell.com)
  * Copyright 2011 Xamarin Inc (http://www.xamarin.com)
@@ -110,20 +111,6 @@ static int do_coverage = 0;
 static gboolean debug_coverage = FALSE;
 static MonoProfileSamplingMode sampling_mode = MONO_PROFILER_STAT_MODE_PROCESS;
 
-/* For linux compile with:
- * gcc -fPIC -shared -o libmono-profiler-log.so proflog.c utils.c -Wall -g -lz `pkg-config --cflags --libs mono-2`
- * gcc -o mprof-report decode.c utils.c -Wall -g -lz -lrt -lpthread `pkg-config --cflags mono-2`
- *
- * For osx compile with:
- * gcc -m32 -Dmono_free=free shared -o libmono-profiler-log.dylib proflog.c utils.c -Wall -g -lz `pkg-config --cflags mono-2` -undefined suppress -flat_namespace
- * gcc -m32 -o mprof-report decode.c utils.c -Wall -g -lz -lrt -lpthread `pkg-config --cflags mono-2`
- *
- * Install with:
- * sudo cp mprof-report /usr/local/bin
- * sudo cp libmono-profiler-log.so /usr/local/lib
- * sudo ldconfig
- */
-
 typedef struct _LogBuffer LogBuffer;
 
 /*
@@ -391,6 +378,19 @@ typedef struct _LogBuffer LogBuffer;
  *    number of methods that are fully and partially covered.
  */
 
+/*
+ * Format oddities that we ought to fix:
+ *
+ * - Methods written in emit_bt () should be based on the buffer's base
+ *   method instead of the base pointer.
+ * - The TYPE_SAMPLE_HIT event contains (currently) pointless data like
+ *   always-one unmanaged frame count and always-zero IL offsets.
+ *
+ * These are mostly small things and are not worth a format change by
+ * themselves. They should be done when some other major change has to
+ * be done to the format.
+ */
+
 struct _LogBuffer {
        LogBuffer *next;
        uint64_t time_base;
@@ -668,11 +668,8 @@ find_method (MonoDomain *domain, void *user_data)
 }
 
 static void
-register_method_local (MonoProfiler *prof, MonoDomain *domain, MonoMethod *method, MonoJitInfo *ji)
+register_method_local (MonoProfiler *prof, MonoMethod *method, MonoJitInfo *ji)
 {
-       if (!domain)
-               g_assert (ji);
-
        if (!mono_conc_hashtable_lookup (prof->method_table, method)) {
                if (!ji) {
                        MethodSearch search = { method, NULL };
@@ -694,12 +691,19 @@ register_method_local (MonoProfiler *prof, MonoDomain *domain, MonoMethod *metho
 }
 
 static void
-emit_method (MonoProfiler *prof, LogBuffer *logbuffer, MonoDomain *domain, MonoMethod *method)
+emit_method (MonoProfiler *prof, LogBuffer *logbuffer, MonoMethod *method)
 {
-       register_method_local (prof, domain, method, NULL);
+       register_method_local (prof, method, NULL);
        emit_method_inner (logbuffer, method);
 }
 
+static void
+emit_method_as_ptr (MonoProfiler *prof, LogBuffer *logbuffer, MonoMethod *method)
+{
+       register_method_local (prof, method, NULL);
+       emit_ptr (logbuffer, method);
+}
+
 static void
 emit_obj (LogBuffer *logbuffer, void *ptr)
 {
@@ -1010,7 +1014,7 @@ collect_bt (FrameData *data)
 }
 
 static void
-emit_bt (LogBuffer *logbuffer, FrameData *data)
+emit_bt (MonoProfiler *prof, LogBuffer *logbuffer, FrameData *data)
 {
        /* FIXME: this is actually tons of data and we should
         * just output it the first time and use an id the next
@@ -1022,7 +1026,7 @@ emit_bt (LogBuffer *logbuffer, FrameData *data)
        //if (*p != data.count) {
        //      printf ("bad num frames enc at %d: %d -> %d\n", count, data.count, *p); printf ("frames end: %p->%p\n", p, logbuffer->data); exit(0);}
        while (data->count) {
-               emit_ptr (logbuffer, data->methods [--data->count]);
+               emit_method_as_ptr (prof, logbuffer, data->methods [--data->count]);
        }
 }
 
@@ -1049,7 +1053,7 @@ gc_alloc (MonoProfiler *prof, MonoObject *obj, MonoClass *klass)
        emit_obj (logbuffer, obj);
        emit_value (logbuffer, len);
        if (do_bt)
-               emit_bt (logbuffer, &data);
+               emit_bt (prof, logbuffer, &data);
        EXIT_LOG (logbuffer);
        if (logbuffer->next)
                safe_send (prof, logbuffer);
@@ -1216,27 +1220,27 @@ class_loaded (MonoProfiler *prof, MonoClass *klass, int result)
 }
 
 #ifndef DISABLE_HELPER_THREAD
-static void process_method_enter (MonoProfiler *prof, MonoMethod *method);
+static void process_method_enter_coverage (MonoProfiler *prof, MonoMethod *method);
 #endif /* DISABLE_HELPER_THREAD */
 
 static void
 method_enter (MonoProfiler *prof, MonoMethod *method)
 {
-       uint64_t now;
+       uint64_t now = current_time ();
+
+#ifndef DISABLE_HELPER_THREAD
+       process_method_enter_coverage (prof, method);
+#endif /* DISABLE_HELPER_THREAD */
+
        LogBuffer *logbuffer = ensure_logbuf (16);
        if (logbuffer->call_depth++ > max_call_depth)
                return;
-       now = current_time ();
        ENTER_LOG (logbuffer, "enter");
        emit_byte (logbuffer, TYPE_ENTER | TYPE_METHOD);
        emit_time (logbuffer, now);
-       emit_method (prof, logbuffer, mono_domain_get (), method);
+       emit_method (prof, logbuffer, method);
        EXIT_LOG (logbuffer);
 
-#ifndef DISABLE_HELPER_THREAD
-       process_method_enter (prof, method);
-#endif /* DISABLE_HELPER_THREAD */
-
        process_requests (prof);
 }
 
@@ -1251,7 +1255,7 @@ method_leave (MonoProfiler *prof, MonoMethod *method)
        ENTER_LOG (logbuffer, "leave");
        emit_byte (logbuffer, TYPE_LEAVE | TYPE_METHOD);
        emit_time (logbuffer, now);
-       emit_method (prof, logbuffer, mono_domain_get (), method);
+       emit_method (prof, logbuffer, method);
        EXIT_LOG (logbuffer);
        if (logbuffer->next)
                safe_send (prof, logbuffer);
@@ -1272,7 +1276,7 @@ method_exc_leave (MonoProfiler *prof, MonoMethod *method)
        ENTER_LOG (logbuffer, "eleave");
        emit_byte (logbuffer, TYPE_EXC_LEAVE | TYPE_METHOD);
        emit_time (logbuffer, now);
-       emit_method (prof, logbuffer, mono_domain_get (), method);
+       emit_method (prof, logbuffer, method);
        EXIT_LOG (logbuffer);
        process_requests (prof);
 }
@@ -1283,7 +1287,7 @@ method_jitted (MonoProfiler *prof, MonoMethod *method, MonoJitInfo *ji, int resu
        if (result != MONO_PROFILE_OK)
                return;
 
-       register_method_local (prof, NULL, method, ji);
+       register_method_local (prof, method, ji);
 }
 
 static void
@@ -1332,7 +1336,7 @@ throw_exc (MonoProfiler *prof, MonoObject *object)
        emit_time (logbuffer, now);
        emit_obj (logbuffer, object);
        if (do_bt)
-               emit_bt (logbuffer, &data);
+               emit_bt (prof, logbuffer, &data);
        EXIT_LOG (logbuffer);
        process_requests (prof);
 }
@@ -1348,7 +1352,7 @@ clause_exc (MonoProfiler *prof, MonoMethod *method, int clause_type, int clause_
        emit_time (logbuffer, now);
        emit_value (logbuffer, clause_type);
        emit_value (logbuffer, clause_num);
-       emit_method (prof, logbuffer, mono_domain_get (), method);
+       emit_method (prof, logbuffer, method);
        EXIT_LOG (logbuffer);
 }
 
@@ -1368,7 +1372,7 @@ monitor_event (MonoProfiler *profiler, MonoObject *object, MonoProfilerMonitorEv
        emit_time (logbuffer, now);
        emit_obj (logbuffer, object);
        if (do_bt)
-               emit_bt (logbuffer, &data);
+               emit_bt (profiler, logbuffer, &data);
        EXIT_LOG (logbuffer);
        process_requests (profiler);
 }
@@ -1566,7 +1570,9 @@ add_code_pointer (uintptr_t ip)
        num_code_pages += add_code_page (code_pages, size_code_pages, ip & CPAGE_MASK);
 }
 
-#if defined(HAVE_DL_ITERATE_PHDR) && defined(ELFMAG0)
+/* ELF code crashes on some systems. */
+//#if defined(HAVE_DL_ITERATE_PHDR) && defined(ELFMAG0)
+#if 0
 static void
 dump_ubin (const char *filename, uintptr_t load_addr, uint64_t offset, uintptr_t size)
 {
@@ -1600,7 +1606,9 @@ dump_usym (const char *name, uintptr_t value, uintptr_t size)
        logbuffer->data += len;
 }
 
-#ifdef ELFMAG0
+/* ELF code crashes on some systems. */
+//#if defined(ELFMAG0)
+#if 0
 
 #if SIZEOF_VOID_P == 4
 #define ELF_WSIZE 32
@@ -1689,7 +1697,9 @@ read_elf_symbols (MonoProfiler *prof, const char *filename, void *load_addr)
 }
 #endif
 
-#if defined(HAVE_DL_ITERATE_PHDR) && defined(ELFMAG0)
+/* ELF code crashes on some systems. */
+//#if defined(HAVE_DL_ITERATE_PHDR) && defined(ELFMAG0)
+#if 0
 static int
 elf_dl_callback (struct dl_phdr_info *info, size_t size, void *data)
 {
@@ -1881,10 +1891,9 @@ dump_sample_hits (MonoProfiler *prof, StatBuffer *sbuf)
                emit_uvalue (logbuffer, mbt_count);
                for (i = 0; i < mbt_count; ++i) {
                        MonoMethod *method = (MonoMethod *) sample [i * 4 + 0];
-                       MonoDomain *domain = (MonoDomain *) sample [i * 4 + 1];
                        uintptr_t native_offset = sample [i * 4 + 3];
 
-                       emit_method (prof, logbuffer, domain, method);
+                       emit_method (prof, logbuffer, method);
                        emit_svalue (logbuffer, 0); /* il offset will always be 0 from now on */
                        emit_svalue (logbuffer, native_offset);
                }
@@ -2874,7 +2883,7 @@ dump_coverage (MonoProfiler *prof)
 }
 
 static void
-process_method_enter (MonoProfiler *prof, MonoMethod *method)
+process_method_enter_coverage (MonoProfiler *prof, MonoMethod *method)
 {
        MonoClass *klass;
        MonoImage *image;
index 0734502cc84f5942a3bb48414e1bf2097688e022..f350e4fa4be767c8e24385673a124040d34e02ce 100644 (file)
@@ -736,7 +736,7 @@ test-messages:
 else
 test-messages: w32message.exe
        > test_messages.zero
-       $(with_mono_path) $(JITTEST_PROG_RUN) w32message.exe >& w32message.allout && cmp test_messages.zero w32message.allout
+       $(with_mono_path) $(JITTEST_PROG_RUN) w32message.exe > w32message.allout 2>&1 && cmp test_messages.zero w32message.allout
 endif
 endif
 
index 55c4badffcda2e9939607a2de19bce86e33934d8..936c4868194d900bafc6802d8b09c97cdca350d7 100644 (file)
@@ -71,9 +71,12 @@ class X
                Test (i => ProbeArray (new int [int.MaxValue - i]));
                Test (i => ProbeArray (new int [int.MaxValue - i * 100]));
 
+               // FIXME: This commit 4gb of memory
+               /*
                Console.WriteLine ("strings");
                Test (i => ProbeString ("abcd".PadRight(int.MaxValue - i)));
                Test (i => ProbeString ("abcd".PadRight(int.MaxValue - i * 100)));
+               */
 
                //Console.WriteLine ("no objects allocated - all good");
                return 0;
index 8ff5eef6684851b2e7e30b3fac8c652339d87e93..2c2369589e143fde0125a2b1ca09046b99620031 100644 (file)
@@ -1,7 +1,7 @@
 AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/mono $(LIBGC_CPPFLAGS) $(GLIB_CFLAGS) -DMONO_BINDIR=\"$(bindir)/\" -DMONO_ASSEMBLIES=\"$(assembliesdir)\" -DMONO_CFG_DIR=\"$(confdir)\"
 
 test_cflags = $(AM_CFLAGS) $(SGEN_DEFINES)
-test_ldadd = ../metadata/libmonoruntimesgen.la ../sgen/libmonosgen.la ../io-layer/libwapi.la ../utils/libmonoutils.la \
+test_ldadd = libtestlib.la \
        $(LIBGC_LIBS) $(GLIB_LIBS) -lm $(LIBICONV)
 if PLATFORM_DARWIN
 test_ldflags = -framework CoreFoundation -framework Foundation
@@ -11,7 +11,10 @@ endif
 if !CROSS_COMPILE
 if !HOST_WIN32
 if SUPPORT_BOEHM
-if !PLATFORM_GNU
+
+noinst_LTLIBRARIES = libtestlib.la
+libtestlib_la_SOURCES =
+libtestlib_la_LIBADD = ../metadata/libmonoruntimesgen.la ../sgen/libmonosgen.la ../utils/libmonoutils.la ../io-layer/libwapi.la 
 
 test_sgen_qsort_SOURCES = test-sgen-qsort.c
 test_sgen_qsort_CFLAGS = $(test_cflags)
@@ -37,7 +40,6 @@ noinst_PROGRAMS = test-sgen-qsort test-memfuncs test-mono-linked-list-set test-c
 
 TESTS = test-sgen-qsort test-memfuncs test-mono-linked-list-set test-conc-hashtable
 
-endif !PLATFORM_GNU
 endif SUPPORT_BOEHM
 endif !HOST_WIN32
 endif !CROSS_COMPILE
index 2bed3edf40373dc20fcd235d8f7e1c1580b58333..32cc0e515a146d7d594b3b6f21963df47944bd3b 100644 (file)
@@ -21,6 +21,7 @@ monoutils_sources = \
        dlmalloc.c              \
        mono-counters.c         \
        mono-compiler.h         \
+       mono-complex.h          \
        mono-dl.c               \
        mono-dl-windows.c       \
        mono-dl-darwin.c        \
index 322b9124be99e511e7195de1c57083bc0702cb00..d06a2143a02e6394146385c1a9bc377978701a50 100644 (file)
        : "=r" (offset))
 #endif
 #elif defined(__s390x__)
-# if defined(PIC)
+# if defined(__PIC__)
+#  if !defined(__PIE__)
 // This only works if libmono is linked into the application
-#  define MONO_THREAD_VAR_OFFSET(var,offset) do { guint64 foo;                                 \
-                                               __asm__ ("basr  %%r1,0\n\t"                     \
-                                                        "j     0f\n\t"                         \
-                                                        ".quad " #var "@TLSGD\n\t"             \
+#   define MONO_THREAD_VAR_OFFSET(var,offset) do { guint64 foo;                                \
+                                               __asm__ ("basr  %%r1,0\n\t"                     \
+                                                        "j     0f\n\t"                         \
+                                                        ".quad " #var "@TLSGD\n"               \
                                                         "0:\n\t"                               \
-                                                        "lg    %%r2,4(%%r1)\n\t"               \
+                                                        "lg    %%r2,4(%%r1)\n\t"               \
                                                         "brasl %%r14,__tls_get_offset@PLT:tls_gdcall:"#var"\n\t" \
                                                         "lgr   %0,%%r2\n\t"                    \
                                                        : "=r" (foo) :                          \
                                                        : "1", "2", "14", "cc");                \
                                                offset = foo; } while (0)
+#  elif __PIE__ == 1
+#   define MONO_THREAD_VAR_OFFSET(var,offset) do { guint64 foo;                                        \
+                                               __asm__ ("lg    %0," #var "@GOTNTPOFF(%%r12)\n\t"       \
+                                                        : "=r" (foo));                                 \
+                                               offset = foo; } while (0)
+#  elif __PIE__ == 2
+#   define MONO_THREAD_VAR_OFFSET(var,offset) do { guint64 foo;                                \
+                                               __asm__ ("larl  %%r1," #var "@INDNTPOFF\n\t"    \
+                                                        "lg    %0,0(%%r1)\n\t"                 \
+                                                        : "=r" (foo) :                         \
+                                                        : "1", "cc");                          \
+                                               offset = foo; } while (0)
+#  endif
 # else
-#  define MONO_THREAD_VAR_OFFSET(var,offset) do { guint64 foo;                                 \
-                                               __asm__ ("basr  %%r1,0\n\t"                     \
-                                                        "j     0f\n\t"                         \
-                                                        ".quad " #var "@NTPOFF\n"              \
-                                                        "0:\n\t"                               \
-                                                        "lg    %0,4(%%r1)\n\t"                 \
-                                                       : "=r" (foo) : : "1");                  \
+#  define MONO_THREAD_VAR_OFFSET(var,offset) do { guint64 foo;                         \
+                                               __asm__ ("basr  %%r1,0\n\t"             \
+                                                        "j     0f\n\t"                 \
+                                                        ".quad " #var "@NTPOFF\n"      \
+                                                        "0:\n\t"                       \
+                                                        "lg    %0,4(%%r1)\n\t"         \
+                                                       : "=r" (foo) : : "1");          \
                                                offset = foo; } while (0)
 # endif
-
 #else
 #define MONO_THREAD_VAR_OFFSET(var,offset) (offset) = -1
 #endif
diff --git a/mono/utils/mono-complex.h b/mono/utils/mono-complex.h
new file mode 100644 (file)
index 0000000..798fddb
--- /dev/null
@@ -0,0 +1,95 @@
+/*
+* mono-complex.h: C99 Complex math cross-platform support code
+*
+* Author:
+*      Joao Matos (joao.matos@xamarin.com)
+*
+* Copyright 2015 Xamarin, Inc (http://www.xamarin.com)
+*/
+
+#include <config.h>
+#include <glib.h>
+
+#if !defined (HAVE_COMPLEX_H)
+#include <../../support/libm/complex.h>
+#else
+#include <complex.h>
+#endif
+
+#define _USE_MATH_DEFINES // needed by MSVC to define math constants
+#include <math.h>
+
+#ifdef _MSC_VER
+
+#define double_complex _C_double_complex
+
+static inline
+double_complex mono_double_complex_make(gdouble re, gdouble im)
+{
+       return _Cbuild (re, im);
+}
+
+static inline
+double_complex mono_double_complex_scalar_div(double_complex c, gdouble s)
+{
+       return mono_double_complex_make(creal(c) / s, cimag(c) / s);
+}
+
+static inline
+double_complex mono_double_complex_scalar_mul(double_complex c, gdouble s)
+{
+       return mono_double_complex_make(creal(c) * s, cimag(c) * s);
+}
+
+static inline
+double_complex mono_double_complex_div(double_complex left, double_complex right)
+{
+       double denom = creal(right) * creal(right) + cimag(right) * cimag(right);
+
+       return mono_double_complex_make(
+               (creal(left) * creal(right) + cimag(left) * cimag(right)) / denom,
+               (-creal(left) * cimag(right) + cimag(left) * creal(right)) / denom);
+}
+
+static inline
+double_complex mono_double_complex_sub(double_complex left, double_complex right)
+{
+       return mono_double_complex_make(creal(left) - creal(right), cimag(left)
+               - cimag(right));
+}
+
+#else
+
+#define double_complex double complex
+
+static inline
+double_complex mono_double_complex_make(gdouble re, gdouble im)
+{
+       return re + im * I;
+}
+
+static inline
+double_complex mono_double_complex_scalar_div(double_complex c, gdouble s)
+{
+       return c / s;
+}
+
+static inline
+double_complex mono_double_complex_scalar_mul(double_complex c, gdouble s)
+{
+       return c * s;
+}
+
+static inline
+double_complex mono_double_complex_div(double_complex left, double_complex right)
+{
+       return left / right;
+}
+
+static inline
+double_complex mono_double_complex_sub(double_complex left, double_complex right)
+{
+       return left - right;
+}
+
+#endif
index 601749756628d6a66ae8efe88acf78dea6f36b90..a05c7bab76d9e0d1701bd879e4abf7f2311f1a55 100644 (file)
@@ -166,23 +166,23 @@ mono_sigctx_to_monoctx (void *sigctx, MonoContext *mctx)
 #elif defined(HOST_WIN32)
        CONTEXT *context = (CONTEXT*)sigctx;
 
-       mctx->gregs [AMD64_RIP] = context->gregs [AMD64_RIP];
-       mctx->gregs [AMD64_RAX] = context->gregs [AMD64_RAX];
-       mctx->gregs [AMD64_RCX] = context->gregs [AMD64_RCX];
-       mctx->gregs [AMD64_RDX] = context->gregs [AMD64_RDX];
-       mctx->gregs [AMD64_RBX] = context->gregs [AMD64_RBX];
-       mctx->gregs [AMD64_RSP] = context->gregs [AMD64_RSP];
-       mctx->gregs [AMD64_RBP] = context->gregs [AMD64_RBP];
-       mctx->gregs [AMD64_RSI] = context->gregs [AMD64_RSI];
-       mctx->gregs [AMD64_RDI] = context->gregs [AMD64_RDI];
-       mctx->gregs [AMD64_R8] = context->gregs [AMD64_R8];
-       mctx->gregs [AMD64_R9] = context->gregs [AMD64_R9];
-       mctx->gregs [AMD64_R10] = context->gregs [AMD64_R10];
-       mctx->gregs [AMD64_R11] = context->gregs [AMD64_R11];
-       mctx->gregs [AMD64_R12] = context->gregs [AMD64_R12];
-       mctx->gregs [AMD64_R13] = context->gregs [AMD64_R13];
-       mctx->gregs [AMD64_R14] = context->gregs [AMD64_R14];
-       mctx->gregs [AMD64_R15] = context->gregs [AMD64_R15];
+       mctx->gregs [AMD64_RIP] = context->Rip;
+       mctx->gregs [AMD64_RAX] = context->Rax;
+       mctx->gregs [AMD64_RCX] = context->Rcx;
+       mctx->gregs [AMD64_RDX] = context->Rdx;
+       mctx->gregs [AMD64_RBX] = context->Rbx;
+       mctx->gregs [AMD64_RSP] = context->Rsp;
+       mctx->gregs [AMD64_RBP] = context->Rbp;
+       mctx->gregs [AMD64_RSI] = context->Rsi;
+       mctx->gregs [AMD64_RDI] = context->Rdi;
+       mctx->gregs [AMD64_R8] = context->R8;
+       mctx->gregs [AMD64_R9] = context->R9;
+       mctx->gregs [AMD64_R10] = context->R10;
+       mctx->gregs [AMD64_R11] = context->R11;
+       mctx->gregs [AMD64_R12] = context->R12;
+       mctx->gregs [AMD64_R13] = context->R13;
+       mctx->gregs [AMD64_R14] = context->R14;
+       mctx->gregs [AMD64_R15] = context->R15;
 #else
        MonoContext *ctx = (MonoContext *)sigctx;
 
@@ -236,23 +236,23 @@ mono_monoctx_to_sigctx (MonoContext *mctx, void *sigctx)
 #elif defined(HOST_WIN32)
        CONTEXT *context = (CONTEXT*)sigctx;
 
-       context->gregs [AMD64_RIP] = mctx->gregs [AMD64_RIP];
-       context->gregs [AMD64_RAX] = mctx->gregs [AMD64_RAX];
-       context->gregs [AMD64_RCX] = mctx->gregs [AMD64_RCX];
-       context->gregs [AMD64_RDX] = mctx->gregs [AMD64_RDX];
-       context->gregs [AMD64_RBX] = mctx->gregs [AMD64_RBX];
-       context->gregs [AMD64_RSP] = mctx->gregs [AMD64_RSP];
-       context->gregs [AMD64_RBP] = mctx->gregs [AMD64_RBP];
-       context->gregs [AMD64_RSI] = mctx->gregs [AMD64_RSI];
-       context->gregs [AMD64_RDI] = mctx->gregs [AMD64_RDI];
-       context->gregs [AMD64_R8] = mctx->gregs [AMD64_R8];
-       context->gregs [AMD64_R9] = mctx->gregs [AMD64_R9];
-       context->gregs [AMD64_R10] = mctx->gregs [AMD64_R10];
-       context->gregs [AMD64_R11] = mctx->gregs [AMD64_R11];
-       context->gregs [AMD64_R12] = mctx->gregs [AMD64_R12];
-       context->gregs [AMD64_R13] = mctx->gregs [AMD64_R13];
-       context->gregs [AMD64_R14] = mctx->gregs [AMD64_R14];
-       context->gregs [AMD64_R15] = mctx->gregs [AMD64_R15];
+       context->Rip = mctx->gregs [AMD64_RIP];
+       context->Rax = mctx->gregs [AMD64_RAX];
+       context->Rcx = mctx->gregs [AMD64_RCX];
+       context->Rdx = mctx->gregs [AMD64_RDX];
+       context->Rbx = mctx->gregs [AMD64_RBX];
+       context->Rsp = mctx->gregs [AMD64_RSP];
+       context->Rbp = mctx->gregs [AMD64_RBP];
+       context->Rsi = mctx->gregs [AMD64_RSI];
+       context->Rdi = mctx->gregs [AMD64_RDI];
+       context->R8 = mctx->gregs [AMD64_R8];
+       context->R9 = mctx->gregs [AMD64_R9];
+       context->R10 = mctx->gregs [AMD64_R10];
+       context->R11 = mctx->gregs [AMD64_R11];
+       context->R12 = mctx->gregs [AMD64_R12];
+       context->R13 = mctx->gregs [AMD64_R13];
+       context->R14 = mctx->gregs [AMD64_R14];
+       context->R15 = mctx->gregs [AMD64_R15];
 #else
        MonoContext *ctx = (MonoContext *)sigctx;
 
index b1cd30f9045380899b30fbaf73bc20b224c24585..ff7028555c18d05f5a310a58a5caa2739e7cd4c0 100644 (file)
@@ -50,4 +50,15 @@ mono_dl_get_executable_path (char *buf, int buflen)
        return -1;
 }
 
+const char*
+mono_dl_get_system_dir (void)
+{
+#ifdef TARGET_IOS
+       /* IOS9 can't load system libraries using relative paths, i.e. 'libc' doesn't work, but '/usr/lib/libc' does. */
+       return "/usr/lib";
+#else
+       return NULL;
+#endif
+}
+
 #endif
index be52a3e6e4cad1fbc7514daf02da7a9b17382c88..09eed6222e2ff55103654335c72eed343cca79a1 100644 (file)
@@ -47,6 +47,13 @@ mono_dl_get_executable_path (char *buf, int buflen)
 {
        return readlink ("/proc/self/exe", buf, buflen - 1);
 }
+
+const char*
+mono_dl_get_system_dir (void)
+{
+       return NULL;
+}
+
 #endif
 
 void *
index 5dabce44835eac318bad847223314e7253ab8708..19ff818f733af5e40e54a74347a51b75a2a92201 100644 (file)
@@ -159,4 +159,10 @@ mono_dl_get_executable_path (char *buf, int buflen)
        return -1; //TODO
 }
 
+const char*
+mono_dl_get_system_dir (void)
+{
+       return NULL;
+}
+
 #endif
index c3c59c160785ee06c898fda10f3cec8f9575eb40..1da98cb8e1d0f812e6a8624ce706b9741a88efeb 100644 (file)
@@ -43,6 +43,7 @@ void* mono_dl_lookup_symbol (MonoDl *module, const char *name);
 int mono_dl_convert_flags (int flags);
 char* mono_dl_current_error_string (void);
 int mono_dl_get_executable_path (char *buf, int buflen);
+const char* mono_dl_get_system_dir (void);
 
 #endif /* __MONO_UTILS_DL_H__ */
 
index dbf019cffaf6b3679c51f1156349e49ba4a964c1..edbf934ac9bf7321a524a47459231121c00d9f40 100644 (file)
@@ -88,7 +88,7 @@ and reduce the number of casts drastically.
 /* Logging - enable them below if you need specific logging for the category you need */
 #define MOSTLY_ASYNC_SAFE_PRINTF(...) do { \
        char __buff[1024];      __buff [0] = '\0'; \
-       snprintf (__buff, sizeof (__buff), __VA_ARGS__);        \
+       g_snprintf (__buff, sizeof (__buff), __VA_ARGS__);      \
        write (1, __buff, strlen (__buff));     \
 } while (0)