Merge pull request #5659 from kumpera/fix_59824
authorRodrigo Kumpera <kumpera@users.noreply.github.com>
Fri, 29 Sep 2017 23:17:03 +0000 (16:17 -0700)
committerGitHub <noreply@github.com>
Fri, 29 Sep 2017 23:17:03 +0000 (16:17 -0700)
[runtime] Synthesize IList and IReadOnlyList for the element type of enum errays. Fixes #59824

38 files changed:
CODEOWNERS
mcs/class/System.Net.Http/System.Net.Http/HttpClient.cs
mcs/class/System.Net.Http/Test/System.Net.Http/HttpClientTest.cs
mcs/class/System/System.Net/HttpListenerRequest.cs
mcs/class/System/Test/System.Net/HttpListenerRequestTest.cs
mcs/class/corlib/System.IO/DirectoryInfo.cs
mcs/class/corlib/System.IO/MonoIO.cs
mcs/class/corlib/System.Reflection.Emit/AssemblyBuilder.cs
mcs/class/corlib/Test/System.Reflection.Emit/DynamicMethodTest.cs
mcs/class/corlib/Test/System.Reflection.Emit/ILGeneratorTest.cs
mono/metadata/class-internals.h
mono/metadata/dynamic-image.c
mono/metadata/icall-def.h
mono/metadata/metadata-internals.h
mono/metadata/object-internals.h
mono/metadata/object.c
mono/metadata/sgen-mono.c
mono/metadata/sgen-stw.c
mono/metadata/sre.c
mono/metadata/w32file.c
mono/metadata/w32file.h
mono/mini/aot-runtime-wasm.c
mono/mini/aot-tests.cs
mono/mini/builtin-types.cs
mono/mini/devirtualization.cs
mono/mini/exceptions.cs
mono/mini/gc-test.cs
mono/mini/interp/interp.c
mono/mini/interp/transform.c
mono/mini/mini-exceptions.c
mono/mini/mini-native-types.c
mono/mini/mini-runtime.c
mono/mini/mini.h
mono/mini/test.cs
mono/mini/trace.c
mono/sgen/sgen-conf.h
mono/sgen/sgen-gc.c
packaging/MacSDK/msbuild.py

index d72a176cb795514a1423bb2f986c4757abccc6f1..0624cbdfa588e30a86795b7dd8d6ec9aaad4bd6f 100644 (file)
@@ -76,6 +76,7 @@
 /mono/metadata/threads* @luhenry @kumpera
 /mono/metadata/threadpool* @luhenry
 /mono/metadata/w32* @luhenry
+/mono/metadata/*-win* @lateralusX @luhenry
 
 /mono/mini @vargaz @kumpera
 /mono/mini/*cfgdump* @lewurm
@@ -95,8 +96,9 @@
 /mono/utils/mono-hwcap* @alexrp
 /mono/utils/mono-mem* @alexrp
 /mono/utils/mono-threads* @luhenry @kumpera
+/mono/utils/*-win* @lateralusX @kumpera
 
-/msvc @ntherning
+/msvc @lateralusX
 /msvc/*profiler* @alexrp
 /msvc/scripts @akoeplinger
 
index baa6dd9f0d26cc6a219c5187164013043009be9d..c9fd2354abe136be56708c73b9a2bf30ff6f2098 100644 (file)
@@ -96,7 +96,7 @@ namespace System.Net.Http
                                return timeout;
                        }
                        set {
-                               if (value != System.Threading.Timeout.InfiniteTimeSpan && value < TimeSpan.Zero)
+                               if (value != System.Threading.Timeout.InfiniteTimeSpan && (value <= TimeSpan.Zero || value.Ticks > int.MaxValue))
                                        throw new ArgumentOutOfRangeException ();
 
                                timeout = value;
index 8344c26cc68687b585f7be3a8ef3dd08c2f36328..c87bb7562a16337730f027439914e8bfcfb2b383 100644 (file)
@@ -308,6 +308,18 @@ namespace MonoTests.System.Net.Http
                                Assert.Fail ("#2");
                        } catch (ArgumentOutOfRangeException) {
                        }
+
+                       try {
+                               client.Timeout = TimeSpan.Zero;
+                               Assert.Fail ("#3");
+                       } catch (ArgumentOutOfRangeException) {
+                       }
+
+                       try {
+                               client.Timeout = new TimeSpan(int.MaxValue + 1L);
+                               Assert.Fail ("#3");
+                       } catch (ArgumentOutOfRangeException) {
+                       }
                }
 
                [Test]
index 2a690b0e3b2519630622fb0e815026af226ab65b..e351807aa3befe092968fe95930f0c1820320e00 100644 (file)
@@ -330,16 +330,20 @@ namespace System.Net {
                                                        if (current != null) {
                                                                cookies.Add (current);
                                                        }
-                                                       current = new Cookie ();
-                                                       int idx = str.IndexOf ('=');
-                                                       if (idx > 0) {
-                                                               current.Name = str.Substring (0, idx).Trim ();
-                                                               current.Value =  str.Substring (idx + 1).Trim ();
-                                                       } else {
-                                                               current.Name = str.Trim ();
-                                                               current.Value = String.Empty;
+                                                       try {
+                                                               current = new Cookie ();
+                                                               int idx = str.IndexOf ('=');
+                                                               if (idx > 0) {
+                                                                       current.Name = str.Substring (0, idx).Trim ();
+                                                                       current.Value =  str.Substring (idx + 1).Trim ();
+                                                               } else {
+                                                                       current.Name = str.Trim ();
+                                                                       current.Value = String.Empty;
+                                                               }
+                                                               current.Version = version;
+                                                       } catch (CookieException) {
+                                                               current = null;
                                                        }
-                                                       current.Version = version;
                                                }
                                        }
                                        if (current != null) {
index 2f24f73ec0d0efc50f2572ae0a8f235ec5c17e2c..2066cc6a6db490128d6ecf29756286db2e776030 100644 (file)
@@ -285,7 +285,19 @@ namespace MonoTests.System.Net
                        var request = (HttpWebRequest)WebRequest.Create (prefix);
                        var rsp = request.GetResponseAsync ();
                        Assert.IsFalse (rsp.Wait (1000), "Don't send on empty write");
+               }
 
+               [Test]
+               public void HttpRequestIgnoreBadCookies ()
+               {
+                       var port = NetworkHelpers.FindFreePort ();
+                       HttpListener listener = HttpListener2Test.CreateAndStartListener (
+                               "http://127.0.0.1:" + port + "/HttpRequestIgnoreBadCookiesTest/");
+                       NetworkStream ns = HttpListener2Test.CreateNS (port);
+                       HttpListener2Test.Send (ns, "GET /HttpRequestIgnoreBadCookiesTest/?a=b HTTP/1.1\r\nHost: 127.0.0.1\r\nCookie: ELOQUA=GUID=5ca2346347357f4-f877-4eff-96aa-70fe0b677650; ELQSTATUS=OK; WRUID=609099666.123259461695; CommunityServer-UserCookie2101=lv=Thu, 26 Jul 2012 15:25:11 GMT&mra=Mon, 01 Oct 2012 17:40:05 GMT; PHPSESSID=1234dg3opfjb4qafp0oo645; __utma=9761706.1153317537.1357240270.1357240270.1357317902.2; __utmb=9761706.6.10.1357317902; __utmc=9761706; __utmz=9761706.1357240270.1.1.utmcsr=test.testdomain.com|utmccn=(referral)|utmcmd=referral|utmcct=/test/1234\r\n\r\n");
+                       HttpListenerContext ctx = listener.GetContext ();
+                       HttpListenerRequest request = ctx.Request;
+                       Assert.AreEqual ("/HttpRequestIgnoreBadCookiesTest/?a=b", request.Url.PathAndQuery);
                        listener.Close ();
                }
        }
index 205fadc0026b852b25a17c83bdd4cf76aaff0239..1cf54bf5b2bbf408cea543afcdd4ae1994f922bf 100644 (file)
@@ -41,6 +41,8 @@ using System.Security;
 using System.Text;
 using System.Security.AccessControl;
 
+using Microsoft.Win32.SafeHandles;
+
 namespace System.IO {
        
        [Serializable]
@@ -424,39 +426,57 @@ namespace System.IO {
                        return EnumerateFileSystemInfos (FullPath, searchPattern, searchOption);
                }
 
-               static internal IEnumerable<FileSystemInfo> EnumerateFileSystemInfos (string full, string searchPattern, SearchOption searchOption)
+               static internal IEnumerable<FileSystemInfo> EnumerateFileSystemInfos (string basePath, string searchPattern, SearchOption searchOption)
                {
-                       string path_with_pattern = Path.Combine (full, searchPattern);
-                       IntPtr handle = IntPtr.Zero;
-                       MonoIOError error;
-                       FileAttributes rattr;
-                       bool subdirs = searchOption == SearchOption.AllDirectories;
+                       Path.Validate (basePath);
+
+                       SafeFindHandle findHandle = null;
 
-                       Path.Validate (full);
-                       
                        try {
-                               string s = MonoIO.FindFirst (full, path_with_pattern, out rattr, out error, out handle);
-                               if (s == null)
+                               string filePath;
+                               int nativeAttrs;
+
+                               string basePathWithPattern = Path.Combine (basePath, searchPattern);
+
+                               int nativeError;
+                               try {} finally {
+                                       findHandle = new SafeFindHandle (MonoIO.FindFirstFile (basePathWithPattern, out filePath, out nativeAttrs, out nativeError));
+                               }
+
+                               if (findHandle.IsInvalid) {
+                                       MonoIOError error = (MonoIOError) nativeError;
+                                       if (error != MonoIOError.ERROR_FILE_NOT_FOUND)
+                                               throw MonoIO.GetException (Path.GetDirectoryName (basePathWithPattern), error);
+
                                        yield break;
-                               if (error != 0)
-                                       throw MonoIO.GetException (Path.GetDirectoryName (path_with_pattern), (MonoIOError) error);
+                               }
 
                                do {
-                                       if (((rattr & FileAttributes.ReparsePoint) == 0)){
-                                               if ((rattr & FileAttributes.Directory) != 0)
-                                                       yield return new DirectoryInfo (s);
+                                       if (filePath == null)
+                                               yield break;
+
+                                       if (filePath == "." || filePath == "..")
+                                               continue;
+
+                                       FileAttributes attrs = (FileAttributes) nativeAttrs;
+
+                                       string fullPath = Path.Combine (basePath, filePath);
+
+                                       if ((attrs & FileAttributes.ReparsePoint) == 0) {
+                                               if ((attrs & FileAttributes.Directory) != 0)
+                                                       yield return new DirectoryInfo (fullPath);
                                                else
-                                                       yield return new FileInfo (s);
+                                                       yield return new FileInfo (fullPath);
                                        }
 
-                                       if (((rattr & FileAttributes.Directory) != 0) && subdirs)
-                                               foreach (FileSystemInfo child in EnumerateFileSystemInfos (s, searchPattern, searchOption))
+                                       if ((attrs & FileAttributes.Directory) != 0 && searchOption == SearchOption.AllDirectories) {
+                                               foreach (FileSystemInfo child in EnumerateFileSystemInfos (fullPath, searchPattern, searchOption))
                                                        yield return child;
-
-                               } while ((s = MonoIO.FindNext (handle, out rattr, out error)) != null);
+                                       }
+                               } while (MonoIO.FindNextFile (findHandle.DangerousGetHandle (), out filePath, out nativeAttrs, out int _));
                        } finally {
-                               if (handle != IntPtr.Zero)
-                                       MonoIO.FindClose (handle);
+                               if (findHandle != null)
+                                       findHandle.Dispose ();
                        }
                }
                
index 0dac31494ba7938f586301104382f31e55e721d8..38c8cf3de735623fa52e6cd144ae626ceaed1fe7 100644 (file)
@@ -174,9 +174,6 @@ namespace System.IO
                [MethodImplAttribute (MethodImplOptions.InternalCall)]
                public extern static bool RemoveDirectory (string path, out MonoIOError error);
 
-               [MethodImplAttribute (MethodImplOptions.InternalCall)]
-               public extern static string [] GetFileSystemEntries (string path, string path_with_pattern, int attrs, int mask, out MonoIOError error);
-
                [MethodImplAttribute (MethodImplOptions.InternalCall)]
                public extern static string GetCurrentDirectory (out MonoIOError error);
 
@@ -229,14 +226,6 @@ namespace System.IO
                //
                // Find file methods
                //
-               [MethodImplAttribute (MethodImplOptions.InternalCall)]
-               public extern static string FindFirst (string path, string pattern, out FileAttributes result_attr, out MonoIOError error, out IntPtr handle);
-               
-               [MethodImplAttribute (MethodImplOptions.InternalCall)]
-               public extern static string FindNext (IntPtr handle, out FileAttributes result_attr, out MonoIOError error);
-               
-               [MethodImplAttribute (MethodImplOptions.InternalCall)]
-               public extern static int FindClose (IntPtr handle);
 
                [MethodImplAttribute (MethodImplOptions.InternalCall)]
                public extern static IntPtr FindFirstFile (string path_with_pattern, out string fileName, out int fileAttr, out int error);
index 9312f1da9fe53725d40125713af0238d09eeb27a..9c642ffa0062445fd98db4fe2ef938197a3fade6 100644 (file)
@@ -257,6 +257,9 @@ namespace System.Reflection.Emit
                [MethodImplAttribute(MethodImplOptions.InternalCall)]
                private static extern void basic_init (AssemblyBuilder ab);
 
+               [MethodImplAttribute(MethodImplOptions.InternalCall)]
+               static extern void UpdateNativeCustomAttributes (AssemblyBuilder ab);
+
                /* Keep this in sync with codegen.cs in mcs */
                private const AssemblyBuilderAccess COMPILER_ACCESS = (AssemblyBuilderAccess) 0x800;
 
@@ -949,6 +952,12 @@ namespace System.Reflection.Emit
                                cattrs = new CustomAttributeBuilder [1];
                                cattrs [0] = customBuilder;
                        }
+
+                       /*
+                       Only update the native list of custom attributes if we're adding one that is known to change dynamic execution behavior.
+                       */
+                       if (customBuilder.Ctor != null && customBuilder.Ctor.DeclaringType == typeof (System.Runtime.CompilerServices.RuntimeCompatibilityAttribute))
+                               UpdateNativeCustomAttributes (this);
                }
 
                [ComVisible (true)]
index fcf6284a00e429177e7982527ec5d406ba9eb426..f8c898d2f00095dc76ad39d04fed5704732b807f 100644 (file)
@@ -610,6 +610,102 @@ namespace MonoTests.System.Reflection.Emit
                        invoke (444);
                }
 
+               static Func<int> EmitDelegate (DynamicMethod dm) {
+                       ILGenerator il = dm.GetILGenerator ();
+                       var ret_val = il.DeclareLocal (typeof (int));
+                       var leave_label = il.DefineLabel ();
+
+                       //ret = 1;
+                       il.Emit (OpCodes.Ldc_I4, 1);
+                       il.Emit (OpCodes.Stloc, ret_val);
+
+                       // try {
+                       il.BeginExceptionBlock ();
+                       //      throw "hello";
+                       il.Emit (OpCodes.Ldstr, "hello");
+                       il.Emit (OpCodes.Throw, typeof (string));
+                       //      ret = 2
+                       il.Emit (OpCodes.Ldc_I4, 2);
+                       il.Emit (OpCodes.Stloc, ret_val);
+                       // }
+                       il.Emit (OpCodes.Leave, leave_label);
+                       //catch (string)
+                       il.BeginCatchBlock (typeof (string));
+                       il.Emit (OpCodes.Pop);
+                       //      ret = 3
+                       il.Emit (OpCodes.Ldc_I4, 3);
+                       il.Emit (OpCodes.Stloc, ret_val);
+                       //}
+                       il.Emit (OpCodes.Leave, leave_label);
+                       il.EndExceptionBlock ();
+
+                       il.MarkLabel (leave_label);
+                       //return ret;
+                       il.Emit (OpCodes.Ldloc, ret_val);
+                       il.Emit (OpCodes.Ret);
+
+                       var dele = (Func<int>)dm.CreateDelegate (typeof (Func<int>));
+                       return dele;
+               }
+
+               [Test] //see bxc #59334
+               public void ExceptionWrapping ()
+               {
+                       AssemblyBuilder ab = AppDomain.CurrentDomain.DefineDynamicAssembly (new AssemblyName ("ehatevfheiw"), AssemblyBuilderAccess.Run);
+                       AssemblyBuilder ab2 = AppDomain.CurrentDomain.DefineDynamicAssembly (new AssemblyName ("ddf4234"), AssemblyBuilderAccess.Run);
+                       CustomAttributeBuilder cab = new CustomAttributeBuilder (
+                                       typeof (RuntimeCompatibilityAttribute).GetConstructor (new Type [0]),
+                                       new object [0],
+                                       new PropertyInfo[] { typeof (RuntimeCompatibilityAttribute).GetProperty ("WrapNonExceptionThrows") },
+                                       new object[] { true });
+                       ab2.SetCustomAttribute (cab);
+
+                       AssemblyBuilder ab3 = AppDomain.CurrentDomain.DefineDynamicAssembly (new AssemblyName ("frfhfher"), AssemblyBuilderAccess.Run);
+                       //1 NamedArg. Property name: WrapNonExceptionThrows value: true (0x01) 
+                       byte[] blob = new byte[] { 0x01, 0x00, 0x01, 0x00, 0x54, 0x02, 0x16, 0x57, 0x72, 0x61, 0x70, 0x4E, 0x6F, 0x6E, 0x45, 0x78,
+                               0x63, 0x65, 0x70, 0x74, 0x69, 0x6F, 0x6E, 0x54, 0x68, 0x72, 0x6F, 0x77, 0x73, 0x01 };
+                       ab3.SetCustomAttribute (typeof (RuntimeCompatibilityAttribute).GetConstructor (new Type [0]), blob);
+               
+                       DynamicMethod invoke_no_module = new DynamicMethod("throw_1", typeof (int), new Type [0]);
+                       DynamicMethod invoke_with_module = new DynamicMethod("throw_2", typeof (int), new Type [0], typeof (DynamicMethodTest).Module);
+                       DynamicMethod invoke_with_ab = new DynamicMethod("throw_3", typeof (int), new Type [0], ab.ManifestModule);
+                       DynamicMethod invoke_with_ab2 = new DynamicMethod("throw_4", typeof (int), new Type [0], ab2.ManifestModule);
+                       DynamicMethod invoke_with_ab3 = new DynamicMethod("throw_5", typeof (int), new Type [0], ab3.ManifestModule);
+
+                       int result = 0;
+                       try {
+                               int res = EmitDelegate (invoke_no_module)();
+                               Assert.AreEqual (3, res, "invoke_no_module bad return value");
+                       } catch (RuntimeWrappedException e) {
+                               Assert.Fail ("invoke_no_module threw RWE");
+                       }
+
+                       try {
+                               int res = EmitDelegate (invoke_with_module)();
+                               Assert.Fail ("invoke_with_module did not throw RWE");
+                       } catch (RuntimeWrappedException e) {
+                       }
+
+                       try {
+                               int res = EmitDelegate (invoke_with_ab)();
+                               Assert.AreEqual (3, res, "invoke_with_ab bad return value");
+                       } catch (RuntimeWrappedException e) {
+                               Assert.Fail ("invoke_with_ab threw RWE");
+                       }
+
+                       try {
+                               int res = EmitDelegate (invoke_with_ab2)();
+                               Assert.Fail ("invoke_with_ab2 did not throw RWE");
+                       } catch (RuntimeWrappedException e) {
+                       }
+
+                       try {
+                               int res = EmitDelegate (invoke_with_ab3)();
+                               Assert.Fail ("invoke_with_a3 did not throw RWE");
+                       } catch (RuntimeWrappedException e) {
+                       }                       
+               }
+
 #if !MONODROID
                // RUNTIME: crash
                [Test]
index a31821924c7607f96df896764acb854ff9d61dcf..c943d6859ca60634cc75f9e2278d10163aab871f 100644 (file)
@@ -480,5 +480,97 @@ namespace MonoTests.System.Reflection.Emit
                        Assert.AreEqual (0x02, il [14]); //typedef
                        Assert.AreEqual (0x01, il [19]); //typeref
                }
+
+               [Test]
+               public void MethodRefTokenSame () {
+                       // Get the same non-virtual method from a base and a derived type so
+                       // that the MemberInfo:DeclaredType differs but the tokens are the same.
+                       //
+                       // Regression test for bugzilla #59364
+
+                       DefineBasicMethod ();
+
+                       var m1 = typeof (object).GetMethod ("GetType");
+                       var m2 = typeof (string).GetMethod ("GetType");
+
+                       var value_getter = typeof (RuntimeMethodHandle).GetProperty ("Value").GetMethod;
+
+                       var il = il_gen;
+
+                       var loc = il.DeclareLocal (typeof (RuntimeMethodHandle));
+
+                       // return ((int)(RuntimeMethodHandle (m1).Value == RuntimeMethodHandle (m2).Value)).ToString ()
+                       il.Emit (OpCodes.Ldtoken, m1);
+                       il.Emit (OpCodes.Stloc, loc);
+                       il.Emit (OpCodes.Ldloca, loc);
+                       il.Emit (OpCodes.Call, value_getter);
+                       il.Emit (OpCodes.Ldtoken, m2);
+                       il.Emit (OpCodes.Stloc, loc);
+                       il.Emit (OpCodes.Ldloca, loc);
+                       il.Emit (OpCodes.Call, value_getter);
+                       il.Emit (OpCodes.Ceq);
+                       il.Emit (OpCodes.Box, typeof (Int32));
+                       il.Emit (OpCodes.Callvirt, typeof (object).GetMethod ("ToString"));
+                       il.Emit (OpCodes.Ret);
+
+                       var baked = tb.CreateType ();
+
+                       var x = Activator.CreateInstance (baked);
+                       var m = baked.GetMethod ("F");
+
+                       var s = m.Invoke (x, null);
+
+                       Assert.AreEqual ("1", s);
+                       
+               }
+
+               public class Base {
+                       public int x;
+               }
+
+               public class Derived : Base {
+               }
+
+               [Test]
+               public void FieldRefTokenSame () {
+                       DefineBasicMethod ();
+
+                       // Get the same field from a base and a derived type so hat
+                       // the MemberInfo:DeclaredType differs but the tokens are the same.
+                       //
+                       // Regression test for bugzilla #59364
+
+                       var f1 = typeof (Base).GetField ("x");
+                       var f2 = typeof (Derived).GetField ("x");
+
+                       var value_getter = typeof (RuntimeFieldHandle).GetProperty("Value").GetMethod;
+
+                       var il = il_gen;
+
+                       var loc = il.DeclareLocal (typeof (RuntimeFieldHandle));
+
+                       il.Emit (OpCodes.Ldtoken, f1);
+                       il.Emit (OpCodes.Stloc, loc);
+                       il.Emit (OpCodes.Ldloca, loc);
+                       il.Emit (OpCodes.Call, value_getter);
+                       il.Emit (OpCodes.Ldtoken, f2);
+                       il.Emit (OpCodes.Stloc, loc);
+                       il.Emit (OpCodes.Ldloca, loc);
+                       il.Emit (OpCodes.Call, value_getter);
+                       il.Emit (OpCodes.Ceq);
+                       il.Emit (OpCodes.Box, typeof (Int32));
+                       il.Emit (OpCodes.Callvirt, typeof (object).GetMethod ("ToString"));
+                       il.Emit (OpCodes.Ret);
+
+                       var baked = tb.CreateType ();
+
+                       var x = Activator.CreateInstance (baked);
+                       var m = baked.GetMethod ("F");
+
+                       var s = m.Invoke (x, null);
+
+                       Assert.AreEqual ("1", s);
+               }
+
        }
 }
index f744fc1fdc4c66144ab648e52b7f9f0160953c40..e3d9e18741752ec88e7136cda18776ea7d25c736 100644 (file)
@@ -27,6 +27,7 @@ extern gboolean mono_align_small_structs;
 typedef struct _MonoMethodWrapper MonoMethodWrapper;
 typedef struct _MonoMethodInflated MonoMethodInflated;
 typedef struct _MonoMethodPInvoke MonoMethodPInvoke;
+typedef struct _MonoDynamicMethod MonoDynamicMethod;
 
 /* Properties that applies to a group of structs should better use a higher number
  * to avoid colision with type specific properties.
@@ -100,6 +101,11 @@ struct _MonoMethodWrapper {
        void *method_data;
 };
 
+struct _MonoDynamicMethod {
+       MonoMethodWrapper method;
+       MonoAssembly *assembly;
+};
+
 struct _MonoMethodPInvoke {
        MonoMethod method;
        gpointer addr;
index 85fd2708111b57412ebf56997d5a28e1e9a7609a..fb381452b5a6127d598d81f5602ca7a57742d8ed 100644 (file)
@@ -355,7 +355,6 @@ mono_dynamic_image_create (MonoDynamicAssembly *assembly, char *assembly_name, c
        image->method_aux_hash = g_hash_table_new (NULL, NULL);
        image->vararg_aux_hash = g_hash_table_new (NULL, NULL);
        image->handleref = g_hash_table_new (NULL, NULL);
-       image->handleref_managed = mono_g_hash_table_new_type ((GHashFunc)mono_object_hash, NULL, MONO_HASH_KEY_GC, MONO_ROOT_SOURCE_REFLECTION, "dynamic module reference-to-token table");
        image->tokens = mono_g_hash_table_new_type (NULL, NULL, MONO_HASH_VALUE_GC, MONO_ROOT_SOURCE_REFLECTION, "dynamic module tokens table");
        image->generic_def_objects = mono_g_hash_table_new_type (NULL, NULL, MONO_HASH_VALUE_GC, MONO_ROOT_SOURCE_REFLECTION, "dynamic module generic definitions table");
        image->typespec = g_hash_table_new ((GHashFunc)mono_metadata_type_hash, (GCompareFunc)mono_metadata_type_equal);
@@ -475,7 +474,6 @@ void
 mono_dynamic_image_release_gc_roots (MonoDynamicImage *image)
 {
        release_hashtable (&image->token_fixups);
-       release_hashtable (&image->handleref_managed);
        release_hashtable (&image->tokens);
        release_hashtable (&image->remapped_tokens);
        release_hashtable (&image->generic_def_objects);
@@ -495,8 +493,6 @@ mono_dynamic_image_free (MonoDynamicImage *image)
                g_hash_table_destroy (di->typeref);
        if (di->handleref)
                g_hash_table_destroy (di->handleref);
-       if (di->handleref_managed)
-               mono_g_hash_table_destroy (di->handleref_managed);
        if (di->tokens)
                mono_g_hash_table_destroy (di->tokens);
        if (di->remapped_tokens)
index 28615d8c1a986bb9eacb71051805387e20e365f0..aa9404b3f5304cd6eed1b4e75a21371bb124fd37 100644 (file)
@@ -365,17 +365,13 @@ ICALL(MONOIO_5, "DeleteFile(string,System.IO.MonoIOError&)", ves_icall_System_IO
 #endif /* !PLATFORM_RO_FS */
 ICALL(MONOIO_38, "DumpHandles", ves_icall_System_IO_MonoIO_DumpHandles)
 ICALL(MONOIO_34, "DuplicateHandle", ves_icall_System_IO_MonoIO_DuplicateHandle)
-ICALL(MONOIO_37, "FindClose", ves_icall_System_IO_MonoIO_FindClose)
 ICALL(MONOIO_37a, "FindCloseFile", ves_icall_System_IO_MonoIO_FindCloseFile)
-ICALL(MONOIO_35, "FindFirst", ves_icall_System_IO_MonoIO_FindFirst)
 ICALL(MONOIO_35a, "FindFirstFile", ves_icall_System_IO_MonoIO_FindFirstFile)
-ICALL(MONOIO_36, "FindNext", ves_icall_System_IO_MonoIO_FindNext)
 ICALL(MONOIO_36a, "FindNextFile", ves_icall_System_IO_MonoIO_FindNextFile)
 ICALL(MONOIO_6, "Flush(intptr,System.IO.MonoIOError&)", ves_icall_System_IO_MonoIO_Flush)
 ICALL(MONOIO_7, "GetCurrentDirectory(System.IO.MonoIOError&)", ves_icall_System_IO_MonoIO_GetCurrentDirectory)
 ICALL(MONOIO_8, "GetFileAttributes(string,System.IO.MonoIOError&)", ves_icall_System_IO_MonoIO_GetFileAttributes)
 ICALL(MONOIO_9, "GetFileStat(string,System.IO.MonoIOStat&,System.IO.MonoIOError&)", ves_icall_System_IO_MonoIO_GetFileStat)
-ICALL(MONOIO_10, "GetFileSystemEntries", ves_icall_System_IO_MonoIO_GetFileSystemEntries)
 ICALL(MONOIO_11, "GetFileType(intptr,System.IO.MonoIOError&)", ves_icall_System_IO_MonoIO_GetFileType)
 ICALL(MONOIO_12, "GetLength(intptr,System.IO.MonoIOError&)", ves_icall_System_IO_MonoIO_GetLength)
 #ifndef PLATFORM_RO_FS
@@ -535,7 +531,8 @@ ICALL(ASSEMN_2, "get_public_token", mono_digest_get_public_token)
 ICALL_TYPE(CATTR_DATA, "System.Reflection.CustomAttributeData", CATTR_DATA_1)
 ICALL(CATTR_DATA_1, "ResolveArgumentsInternal", ves_icall_System_Reflection_CustomAttributeData_ResolveArgumentsInternal)
 
-ICALL_TYPE(ASSEMB, "System.Reflection.Emit.AssemblyBuilder", ASSEMB_2)
+ICALL_TYPE(ASSEMB, "System.Reflection.Emit.AssemblyBuilder", ASSEMB_1)
+HANDLES(ICALL(ASSEMB_1, "UpdateNativeCustomAttributes", ves_icall_AssemblyBuilder_UpdateNativeCustomAttributes))
 ICALL(ASSEMB_2, "basic_init", ves_icall_AssemblyBuilder_basic_init)
 
 #ifndef DISABLE_REFLECTION_EMIT
index 68bf872fbfe1a64e74e92cad2f7076ea6be0ad5e..24cde472b2665a8e0d0a401e2910c53c7000362f 100644 (file)
@@ -503,7 +503,6 @@ struct _MonoDynamicImage {
        GHashTable *typespec;
        GHashTable *typeref;
        GHashTable *handleref;
-       MonoGHashTable *handleref_managed;
        MonoGHashTable *tokens;
        GHashTable *blob_cache;
        GHashTable *standalonesig_cache;
index 3b4db614bba06297be0e6e70e2a96e35f4e9a21a..26b11d77371cea4845516ba3b19805a7f4390335 100644 (file)
@@ -1926,8 +1926,8 @@ ves_icall_ModuleBuilder_GetRegisteredToken (MonoReflectionModuleBuilderHandle mb
 void
 ves_icall_AssemblyBuilder_basic_init (MonoReflectionAssemblyBuilder *assemblyb);
 
-MonoReflectionModule*
-ves_icall_AssemblyBuilder_InternalAddModule (MonoReflectionAssemblyBuilder *ab, MonoString *fileName);
+void
+ves_icall_AssemblyBuilder_UpdateNativeCustomAttributes (MonoReflectionAssemblyBuilderHandle assemblyb, MonoError *error);
 
 MonoArray*
 ves_icall_CustomAttributeBuilder_GetBlob (MonoReflectionAssembly *assembly, MonoObject *ctor, MonoArray *ctorArgs, MonoArray *properties, MonoArray *propValues, MonoArray *fields, MonoArray* fieldValues);
index 9ace3f66652855063c4af180e32252fb48708dc2..457c50e02cc115b4deeeaa547ff0453ef9df24c5 100644 (file)
@@ -7410,6 +7410,9 @@ mono_wait_handle_get_handle (MonoWaitHandle *handle)
 static MonoObject*
 mono_runtime_capture_context (MonoDomain *domain, MonoError *error)
 {
+#ifdef HOST_WASM
+       return mono_runtime_invoke_checked (mono_get_context_capture_method (), NULL, NULL, error);
+#else
        MONO_REQ_GC_UNSAFE_MODE;
 
        RuntimeInvokeFunction runtime_invoke;
@@ -7431,6 +7434,7 @@ mono_runtime_capture_context (MonoDomain *domain, MonoError *error)
        runtime_invoke = (RuntimeInvokeFunction)domain->capture_context_runtime_invoke;
 
        return runtime_invoke (NULL, NULL, NULL, domain->capture_context_method);
+#endif
 }
 /**
  * mono_async_result_new:
index 33d1e52dd8d54de2bb03247eb072253093d70f88..4f8a285f4993c05e2bf1a4a90c99967917841032 100644 (file)
@@ -2361,6 +2361,10 @@ sgen_client_scan_thread_data (void *start_nursery, void *end_nursery, gboolean p
 {
        scan_area_arg_start = start_nursery;
        scan_area_arg_end = end_nursery;
+#ifdef HOST_WASM
+       //Under WASM we don't scan thread stacks and we can't trust the values we find there either.
+       return;
+#endif
 
        FOREACH_THREAD (info) {
                int skip_reason = 0;
index 48ce7f963ed23cfab6cc0eb68b6b42aa4f37eebf..a8a1b9bf32c9f8437d6772e3031ddf03ea1e3625 100644 (file)
@@ -70,6 +70,8 @@ update_current_thread_stack (void *start)
 
 #if !defined(MONO_CROSS_COMPILE) && MONO_ARCH_HAS_MONO_CONTEXT
        MONO_CONTEXT_GET_CURRENT (info->client_info.ctx);
+#elif defined (HOST_WASM)
+       //nothing
 #else
        g_error ("Sgen STW requires a working mono-context");
 #endif
index 649791e7beafcb4104a181e0c720a2509ea53d4b..48df45db99732e672656cef36644cfca5cd8081f 100644 (file)
@@ -374,6 +374,12 @@ mono_save_custom_attrs (MonoImage *image, void *obj, MonoArray *cattrs)
        mono_image_property_insert (image, obj, MONO_PROP_DYNAMIC_CATTR, ainfo);
        mono_loader_unlock ();
 
+}
+#else
+//FIXME some code compiled under DISABLE_REFLECTION_EMIT depends on this function, we should be more aggressively disabling things
+static void
+mono_save_custom_attrs (MonoImage *image, void *obj, MonoArray *cattrs)
+{
 }
 #endif
 
@@ -740,7 +746,7 @@ is_field_on_inst (MonoClassField *field)
 
 #ifndef DISABLE_REFLECTION_EMIT
 static guint32
-mono_image_get_fieldref_token (MonoDynamicImage *assembly, MonoObjectHandle f, MonoClassField *field)
+mono_image_get_fieldref_token (MonoDynamicImage *assembly, MonoClassField *field)
 {
        MonoType *type;
        guint32 token;
@@ -748,7 +754,7 @@ mono_image_get_fieldref_token (MonoDynamicImage *assembly, MonoObjectHandle f, M
        g_assert (field);
        g_assert (field->parent);
 
-       token = GPOINTER_TO_UINT (mono_g_hash_table_lookup (assembly->handleref_managed, MONO_HANDLE_RAW (f)));
+       token = GPOINTER_TO_UINT (g_hash_table_lookup (assembly->handleref, field));
        if (token)
                return token;
 
@@ -761,7 +767,7 @@ mono_image_get_fieldref_token (MonoDynamicImage *assembly, MonoObjectHandle f, M
        token = mono_image_get_memberref_token (assembly, &field->parent->byval_arg,
                                                                                        mono_field_get_name (field),
                                                                                        mono_dynimage_encode_fieldref_signature (assembly, field->parent->image, type));
-       mono_g_hash_table_insert (assembly->handleref_managed, MONO_HANDLE_RAW (f), GUINT_TO_POINTER(token));
+       g_hash_table_insert (assembly->handleref, field, GUINT_TO_POINTER(token));
        return token;
 }
 
@@ -1115,17 +1121,20 @@ mono_image_create_token (MonoDynamicImage *assembly, MonoObjectHandle obj,
                         gboolean create_open_instance, gboolean register_token,
                         MonoError *error)
 {
+       HANDLE_FUNCTION_ENTER ();
        guint32 token = 0;
 
        error_init (error);
 
        MonoClass *klass = mono_handle_class (obj);
+       MonoObjectHandle register_obj = MONO_HANDLE_NEW (MonoObject, NULL);
+       MONO_HANDLE_ASSIGN (register_obj, obj);
 
        /* Check for user defined reflection objects */
        /* TypeDelegator is the only corlib type which doesn't look like a MonoReflectionType */
        if (klass->image != mono_defaults.corlib || (strcmp (klass->name, "TypeDelegator") == 0)) {
                mono_error_set_not_supported (error, "User defined subclasses of System.Type are not yet supported");
-               return 0;
+               goto leave;
        }
 
        /* This function is called from ModuleBuilder:getToken multiple times for the same objects */
@@ -1133,7 +1142,8 @@ mono_image_create_token (MonoDynamicImage *assembly, MonoObjectHandle obj,
 
        if (strcmp (klass->name, "RuntimeType") == 0) {
                MonoType *type = mono_reflection_type_handle_mono_type (MONO_HANDLE_CAST (MonoReflectionType, obj), error);
-               return_val_if_nok (error, 0);
+               if (!is_ok (error))
+                       goto leave;
                MonoClass *mc = mono_class_from_mono_type (type);
                token = mono_metadata_token_from_dor (
                        mono_dynimage_encode_typedef_or_ref_full (assembly, type, !mono_class_is_gtd (mc) || create_open_instance));
@@ -1170,7 +1180,21 @@ mono_image_create_token (MonoDynamicImage *assembly, MonoObjectHandle obj,
                                how_collide = MONO_DYN_IMAGE_TOK_NEW;
                        }
                } else {
-                       token = mono_image_get_methodref_token (assembly, method, create_open_instance);
+                       guint32 methodref_token = mono_image_get_methodref_token (assembly, method, create_open_instance);
+                       /* We need to register a 'canonical' object.  The same
+                        * MonoMethod could have been reflected via different
+                        * classes so the MonoReflectionMethod:reftype could be
+                        * different, and the object lookup in
+                        * dynamic_image_register_token would assert assert. So
+                        * we pick the MonoReflectionMethod object that has the
+                        * reflected type as NULL (ie, take the declaring type
+                        * of the method) */
+                       MonoReflectionMethodHandle canonical_obj =
+                               mono_method_get_object_handle (MONO_HANDLE_DOMAIN (obj), method, NULL, error);
+                       if (!is_ok (error))
+                               goto leave;
+                       MONO_HANDLE_ASSIGN (register_obj, canonical_obj);
+                       token = methodref_token;
                }
                /*g_print ("got token 0x%08x for %s\n", token, m->method->name);*/
        } else if (strcmp (klass->name, "MonoField") == 0) {
@@ -1182,25 +1206,42 @@ mono_image_create_token (MonoDynamicImage *assembly, MonoObjectHandle obj,
                        token = MONO_TOKEN_FIELD_DEF | field_table_idx;
                        how_collide = MONO_DYN_IMAGE_TOK_NEW;
                } else {
-                       token = mono_image_get_fieldref_token (assembly, obj, field);
+                       guint32 fieldref_token = mono_image_get_fieldref_token (assembly, field);
+                       /* Same as methodref: get a canonical object to
+                        * register with the token. */
+                       MonoReflectionFieldHandle canonical_obj =
+                               mono_field_get_object_handle (MONO_HANDLE_DOMAIN (obj), field->parent, field, error);
+                       if (!is_ok (error))
+                               goto leave;
+                       MONO_HANDLE_ASSIGN (register_obj, canonical_obj);
+                       token = fieldref_token;
                }
                /*g_print ("got token 0x%08x for %s\n", token, f->field->name);*/
        } else if (strcmp (klass->name, "MonoArrayMethod") == 0) {
                MonoReflectionArrayMethodHandle m = MONO_HANDLE_CAST (MonoReflectionArrayMethod, obj);
-               token = mono_image_get_array_token (assembly, m, error);
-               return_val_if_nok (error, 0);
+               /* always returns a fresh token */
+               guint32 array_token = mono_image_get_array_token (assembly, m, error);
+               if (!is_ok (error))
+                       goto leave;
+               token = array_token;
+               how_collide = MONO_DYN_IMAGE_TOK_NEW;
        } else if (strcmp (klass->name, "SignatureHelper") == 0) {
                MonoReflectionSigHelperHandle s = MONO_HANDLE_CAST (MonoReflectionSigHelper, obj);
-               token = MONO_TOKEN_SIGNATURE | mono_image_get_sighelper_token (assembly, s, error);
-               return_val_if_nok (error, 0);
+               /* always returns a fresh token */
+               guint32 sig_token = MONO_TOKEN_SIGNATURE | mono_image_get_sighelper_token (assembly, s, error);
+               if (!is_ok (error))
+                       goto leave;
+               token = sig_token;
+               how_collide = MONO_DYN_IMAGE_TOK_NEW;
        } else {
                g_error ("requested token for %s\n", klass->name);
        }
 
        if (register_token)
-               mono_dynamic_image_register_token (assembly, token, obj, how_collide);
+               mono_dynamic_image_register_token (assembly, token, register_obj, how_collide);
 
-       return token;
+leave:
+       HANDLE_FUNCTION_RETURN_VAL (token);
 }
 
 
@@ -2777,7 +2818,7 @@ reflection_methodbuilder_to_mono_method (MonoClass *klass,
                        (rmb->iattrs & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL))
                m = (MonoMethod *)image_g_new0 (image, MonoMethodPInvoke, 1);
        else
-               m = (MonoMethod *)image_g_new0 (image, MonoMethodWrapper, 1);
+               m = (MonoMethod *)image_g_new0 (image, MonoDynamicMethod, 1);
 
        wrapperm = (MonoMethodWrapper*)m;
 
@@ -2872,6 +2913,8 @@ reflection_methodbuilder_to_mono_method (MonoClass *klass,
                }
 
                wrapperm->header = header;
+               MonoDynamicMethod *dm = (MonoDynamicMethod*)wrapperm;
+               dm->assembly = klass->image->assembly;
        }
 
        if (rmb->generic_params) {
@@ -3908,6 +3951,7 @@ reflection_create_dynamic_method (MonoReflectionDynamicMethodHandle ref_mb, Mono
                rmb.refs [i + 1] = handle_class;
        }               
 
+       MonoAssembly *ass = NULL;
        if (mb->owner) {
                MonoType *owner_type = mono_reflection_type_get_handle ((MonoReflectionType*)mb->owner, error);
                if (!is_ok (error)) {
@@ -3915,11 +3959,14 @@ reflection_create_dynamic_method (MonoReflectionDynamicMethodHandle ref_mb, Mono
                        return FALSE;
                }
                klass = mono_class_from_mono_type (owner_type);
+               ass = klass->image->assembly;
        } else {
                klass = mono_defaults.object_class;
+               ass = (mb->module && mb->module->image) ? mb->module->image->assembly : NULL;
        }
 
        mb->mhandle = handle = reflection_methodbuilder_to_mono_method (klass, &rmb, sig, error);
+       ((MonoDynamicMethod*)handle)->assembly = ass;
        g_free (rmb.refs);
        return_val_if_nok (error, FALSE);
 
@@ -4371,6 +4418,18 @@ ves_icall_AssemblyBuilder_basic_init (MonoReflectionAssemblyBuilder *assemblyb)
        mono_reflection_dynimage_basic_init (assemblyb);
 }
 
+void
+ves_icall_AssemblyBuilder_UpdateNativeCustomAttributes (MonoReflectionAssemblyBuilderHandle assemblyb, MonoError *error)
+{
+       MonoArrayHandle cattrs = MONO_HANDLE_NEW_GET (MonoArray, assemblyb, cattrs);
+
+       MonoReflectionAssemblyHandle assembly_handle = MONO_HANDLE_CAST (MonoReflectionAssembly, assemblyb);
+       MonoAssembly *assembly = MONO_HANDLE_GETVAL (assembly_handle, assembly);
+       g_assert (assembly);
+
+       mono_save_custom_attrs (assembly->image, assembly, MONO_HANDLE_RAW (cattrs));
+}
+
 void
 ves_icall_EnumBuilder_setup_enum_type (MonoReflectionTypeHandle enumtype,
                                       MonoReflectionTypeHandle t,
index 325767f52434e9fbcb91aa60963c18d518354651..f10ae499645e1afd7093c4ca76c1d731d239a85e 100644 (file)
@@ -285,167 +285,6 @@ ves_icall_System_IO_MonoIO_RemoveDirectory (MonoString *path, gint32 *error)
        return(ret);
 }
 
-static gchar *
-get_search_dir (const gunichar2 *pattern)
-{
-       gchar *p;
-       gchar *result;
-
-       p = g_utf16_to_utf8 (pattern, -1, NULL, NULL, NULL);
-       result = g_path_get_dirname (p);
-       g_free (p);
-       return result;
-}
-
-static GPtrArray *
-get_filesystem_entries (const gunichar2 *path,
-                                                const gunichar2 *path_with_pattern,
-                                                gint attrs, gint mask,
-                                                gint32 *error)
-{
-       int i;
-       WIN32_FIND_DATA data;
-       HANDLE find_handle;
-       GPtrArray *names = NULL;
-       gchar *utf8_path = NULL, *utf8_result, *full_name;
-       gint32 attributes;
-
-       mask = convert_attrs ((MonoFileAttributes)mask);
-       attributes = get_file_attributes (path);
-       if (attributes != -1) {
-               if ((attributes & FILE_ATTRIBUTE_DIRECTORY) == 0) {
-                       *error = ERROR_INVALID_NAME;
-                       goto fail;
-               }
-       } else {
-               *error = mono_w32error_get_last ();
-               goto fail;
-       }
-       
-       find_handle = mono_w32file_find_first (path_with_pattern, &data);
-       if (find_handle == INVALID_HANDLE_VALUE) {
-               gint32 find_error = mono_w32error_get_last ();
-               
-               if (find_error == ERROR_FILE_NOT_FOUND || find_error == ERROR_NO_MORE_FILES) {
-                       /* No files, so just return an empty array */
-                       goto fail;
-               }
-               
-               *error = find_error;
-               goto fail;
-       }
-
-       utf8_path = get_search_dir (path_with_pattern);
-       names = g_ptr_array_new ();
-
-       do {
-               if ((data.cFileName[0] == '.' && data.cFileName[1] == 0) ||
-                   (data.cFileName[0] == '.' && data.cFileName[1] == '.' && data.cFileName[2] == 0)) {
-                       continue;
-               }
-               
-               if ((data.dwFileAttributes & mask) == attrs) {
-                       utf8_result = g_utf16_to_utf8 (data.cFileName, -1, NULL, NULL, NULL);
-                       if (utf8_result == NULL) {
-                               continue;
-                       }
-                       
-                       full_name = g_build_filename (utf8_path, utf8_result, NULL);
-                       g_ptr_array_add (names, full_name);
-
-                       g_free (utf8_result);
-               }
-       } while(mono_w32file_find_next (find_handle, &data));
-
-       if (mono_w32file_find_close (find_handle) == FALSE) {
-               *error = mono_w32error_get_last ();
-               goto fail;
-       }
-
-       g_free (utf8_path);
-       return names;
-fail:
-       if (names) {
-               for (i = 0; i < names->len; i++)
-                       g_free (g_ptr_array_index (names, i));
-               g_ptr_array_free (names, TRUE);
-       }
-       g_free (utf8_path);
-       return FALSE;
-}
-
-
-MonoArray *
-ves_icall_System_IO_MonoIO_GetFileSystemEntries (MonoString *path,
-                                                MonoString *path_with_pattern,
-                                                gint attrs, gint mask,
-                                                gint32 *ioerror)
-{
-       MonoError error;
-       MonoDomain *domain = mono_domain_get ();
-       MonoArray *result;
-       int i;
-       GPtrArray *names;
-       
-       *ioerror = ERROR_SUCCESS;
-
-       names = get_filesystem_entries (mono_string_chars (path), mono_string_chars (path_with_pattern), attrs, mask, ioerror);
-
-       if (!names) {
-               // If there's no array and no error, then return an empty array.
-               if (*ioerror == ERROR_SUCCESS) {
-                       MonoArray *arr = mono_array_new_checked (domain, mono_defaults.string_class, 0, &error);
-                       mono_error_set_pending_exception (&error);
-                       return arr;
-               }
-               return NULL;
-       }
-
-       result = mono_array_new_checked (domain, mono_defaults.string_class, names->len, &error);
-       if (mono_error_set_pending_exception (&error))
-               goto leave;
-       for (i = 0; i < names->len; i++) {
-               MonoString *name = mono_string_new_checked (domain, (const char *)g_ptr_array_index (names, i), &error);
-               if (mono_error_set_pending_exception (&error))
-                       goto leave;
-               mono_array_setref (result, i, name);
-               g_free (g_ptr_array_index (names, i));
-       }
-leave:
-       g_ptr_array_free (names, TRUE);
-       return result;
-}
-
-typedef struct {
-       MonoDomain *domain;
-       gchar *utf8_path;
-       HANDLE find_handle;
-} IncrementalFind;
-       
-static gboolean
-incremental_find_check_match (IncrementalFind *handle, WIN32_FIND_DATA *data, MonoString **result, MonoError *error)
-{
-       error_init (error);
-       gchar *utf8_result;
-       gchar *full_name;
-       
-       if ((data->cFileName[0] == '.' && data->cFileName[1] == 0) || (data->cFileName[0] == '.' && data->cFileName[1] == '.' && data->cFileName[2] == 0))
-               return FALSE;
-
-       utf8_result = g_utf16_to_utf8 (data->cFileName, -1, NULL, NULL, NULL);
-       if (utf8_result == NULL) 
-               return FALSE;
-       
-       full_name = g_build_filename (handle->utf8_path, utf8_result, NULL);
-       g_free (utf8_result);
-       *result = mono_string_new_checked (mono_domain_get (), full_name, error);
-       g_free (full_name);
-       if (!is_ok (error))
-               return FALSE;
-       
-       return TRUE;
-}
-
 HANDLE
 ves_icall_System_IO_MonoIO_FindFirstFile (MonoString *path_with_pattern, MonoString **file_name, gint32 *file_attr, gint32 *ioerror)
 {
@@ -502,106 +341,6 @@ ves_icall_System_IO_MonoIO_FindCloseFile (HANDLE hnd)
        return mono_w32file_find_close (hnd);
 }
 
-/* FIXME make gc suspendable */
-MonoString *
-ves_icall_System_IO_MonoIO_FindFirst (MonoString *path,
-                                     MonoString *path_with_pattern,
-                                     gint32 *result_attr, gint32 *ioerror,
-                                     gpointer *handle)
-{
-       MonoError error;
-       WIN32_FIND_DATA data;
-       HANDLE find_handle;
-       IncrementalFind *ifh;
-       MonoString *result;
-       
-       *ioerror = ERROR_SUCCESS;
-       
-       find_handle = mono_w32file_find_first (mono_string_chars (path_with_pattern), &data);
-       
-       if (find_handle == INVALID_HANDLE_VALUE) {
-               gint32 find_error = mono_w32error_get_last ();
-               *handle = NULL;
-               
-               if (find_error == ERROR_FILE_NOT_FOUND) 
-                       return NULL;
-               
-               *ioerror = find_error;
-               return NULL;
-       }
-
-       ifh = g_new (IncrementalFind, 1);
-       ifh->find_handle = find_handle;
-       ifh->utf8_path = mono_string_to_utf8_checked (path, &error);
-       if (mono_error_set_pending_exception (&error)) {
-               mono_w32file_find_close (find_handle);
-               g_free (ifh);
-               return NULL;
-       }
-       ifh->domain = mono_domain_get ();
-       *handle = ifh;
-
-       while (incremental_find_check_match (ifh, &data, &result, &error) == 0){
-               if (!is_ok (&error)) {
-                       mono_error_set_pending_exception (&error);
-                       return NULL;
-               }
-               if (mono_w32file_find_next (find_handle, &data) == FALSE){
-                       int e = mono_w32error_get_last ();
-                       if (e != ERROR_NO_MORE_FILES)
-                               *ioerror = e;
-                       return NULL;
-               }
-       }
-       *result_attr = data.dwFileAttributes;
-
-       return result;
-}
-
-/* FIXME make gc suspendable */
-MonoString *
-ves_icall_System_IO_MonoIO_FindNext (gpointer handle, gint32 *result_attr, gint32 *ioerror)
-{
-       MonoError error;
-       IncrementalFind *ifh = (IncrementalFind *)handle;
-       WIN32_FIND_DATA data;
-       MonoString *result;
-
-       error_init (&error);
-       *ioerror = ERROR_SUCCESS;
-       do {
-               if (!is_ok (&error)) {
-                       mono_error_set_pending_exception (&error);
-                       return NULL;
-               }
-               if (mono_w32file_find_next (ifh->find_handle, &data) == FALSE){
-                       int e = mono_w32error_get_last ();
-                       if (e != ERROR_NO_MORE_FILES)
-                               *ioerror = e;
-                       return NULL;
-               }
-       } while (incremental_find_check_match (ifh, &data, &result, &error) == 0);
-
-       *result_attr = data.dwFileAttributes;
-       return result;
-}
-
-int
-ves_icall_System_IO_MonoIO_FindClose (gpointer handle)
-{
-       IncrementalFind *ifh = (IncrementalFind *)handle;
-       gint32 error;
-
-       if (mono_w32file_find_close (ifh->find_handle) == FALSE){
-               error = mono_w32error_get_last ();
-       } else
-               error = ERROR_SUCCESS;
-       g_free (ifh->utf8_path);
-       g_free (ifh);
-
-       return error;
-}
-
 MonoString *
 ves_icall_System_IO_MonoIO_GetCurrentDirectory (gint32 *io_error)
 {
index 65afdb31d786f01475530e1d15ed21ff2c069feb..54f79a39927e093a6d42e13e913513f8b6bd70b6 100644 (file)
@@ -120,12 +120,6 @@ ves_icall_System_IO_MonoIO_CreateDirectory (MonoString *path, gint32 *error);
 extern MonoBoolean
 ves_icall_System_IO_MonoIO_RemoveDirectory (MonoString *path, gint32 *error);
 
-MonoArray *
-ves_icall_System_IO_MonoIO_GetFileSystemEntries (MonoString *path,
-                                                MonoString *path_with_pattern,
-                                                gint mask, gint attrs,
-                                                gint32 *error);
-
 extern gpointer
 ves_icall_System_IO_MonoIO_FindFirstFile (MonoString *path_with_pattern,
                                                MonoString **file_name,
@@ -141,18 +135,6 @@ ves_icall_System_IO_MonoIO_FindNextFile (gpointer hnd,
 extern MonoBoolean
 ves_icall_System_IO_MonoIO_FindCloseFile (gpointer hnd);
 
-extern MonoString *
-ves_icall_System_IO_MonoIO_FindFirst (MonoString *path,
-                                     MonoString *path_with_pattern,
-                                     gint32 *result_mask,
-                                     gint32 *error,
-                                     gpointer *handle);
-extern MonoString *
-ves_icall_System_IO_MonoIO_FindNext (gpointer handle, gint32 *result_mask, gint32 *error);
-
-extern int
-ves_icall_System_IO_MonoIO_FindClose (gpointer handle);
-
 extern MonoString *
 ves_icall_System_IO_MonoIO_GetCurrentDirectory (gint32 *error);
 
index 4fb8906941cb2debcb65916bc9beb051db1101a0..d3b286cd0457418313aaee3dfb651e008074de6c 100644 (file)
@@ -204,6 +204,15 @@ typedef union {
        } pair;
 } interp_pair;
 
+static void
+wasm_invoke_l (void *target_func, InterpMethodArguments *margs)
+{
+       gint64 (*func)(void) = target_func;
+
+       gint64 res = func ();
+       *(gint64*)margs->retval = res;
+}
+
 static void
 wasm_invoke_ll (void *target_func, InterpMethodArguments *margs)
 {
@@ -303,6 +312,15 @@ wasm_invoke_vifffffi (void *target_func, InterpMethodArguments *margs)
                *(float*)&margs->iargs [1]);
 }
 
+static void
+wasm_invoke_ff (void *target_func, InterpMethodArguments *margs)
+{
+       float (*func)(float a) = target_func;
+
+       float res = func (*(float*)&margs->fargs [FIDX (0)]);
+       *(float*)margs->retval = res;
+}
+
 static void
 wasm_enter_icall_trampoline (void *target_func, InterpMethodArguments *margs)
 {
@@ -345,6 +363,8 @@ wasm_enter_icall_trampoline (void *target_func, InterpMethodArguments *margs)
                wasm_invoke_iiiii (target_func, margs);
        else if (!strcmp ("IIIIII", cookie))
                wasm_invoke_iiiiii (target_func, margs);
+       else if (!strcmp ("L", cookie))
+               wasm_invoke_l (target_func, margs);
        else if (!strcmp ("LL", cookie))
                wasm_invoke_ll (target_func, margs);
        else if (!strcmp ("LI", cookie))
@@ -363,6 +383,8 @@ wasm_enter_icall_trampoline (void *target_func, InterpMethodArguments *margs)
                wasm_invoke_viffff (target_func, margs);
        else if (!strcmp ("VIFFFFFI", cookie))
                wasm_invoke_vifffffi (target_func, margs);
+       else if (!strcmp ("FF", cookie))
+               wasm_invoke_ff (target_func, margs);
        else {
                printf ("CANNOT HANDLE COOKIE %s\n", cookie);
                g_assert (0);
index 7f3dafea5c602ab31d1db9590fca9253b7f2a265..82fb3ae674dfe4030e7ff8b9fe35be8cb2c56d12 100644 (file)
@@ -26,6 +26,7 @@ class Tests
 
        public delegate void ArrayDelegate (int[,] arr);
 
+       [Category ("!WASM")] //Requires a working threadpool
        static int test_0_array_delegate_full_aot () {
                ArrayDelegate d = delegate (int[,] arr) {
                };
@@ -260,6 +261,7 @@ class Tests
 
        [Category ("DYNCALL")]
        [Category ("!FULLAOT-AMD64")]
+       [Category ("!INTERPRETER")] //known bug in the interpreter
        public static int test_0_dyncall_nullable () {
                int? v;
 
@@ -410,6 +412,7 @@ class Tests
 
        [Category ("DYNCALL")]
        [Category ("!FULLAOT-AMD64")]
+       [Category ("!INTERPRETER")] //known bug in the interpreter
        public static int test_0_large_nullable_invoke () {
                var s = new LargeStruct () { a = 1, b = 2, c = 3, d = 4 };
 
index ff4f689290d9c57474d3848c39959e94096333d3..de06a0dc579cdc79bdf2ff481ec06379cb09834d 100644 (file)
@@ -792,9 +792,11 @@ public class BuiltinTests {
                return 0;
        }
 
+#if !__MOBILE__
        public static int Main (String[] args) {
                return TestDriver.RunTests (typeof (BuiltinTests), args);
        }
+#endif
 }
 
 
index bf1134be6bb765cbed3bab6e178cd595a00106d3..20ca3bdb70adf1891e8f2d96ca483deafda141c1 100644 (file)
@@ -86,11 +86,13 @@ sealed public class SealedFinal : Middle {
 }
 
 
-class Tests {
+class DevirtualizationTests {
 
+#if !__MOBILE__
        static int Main  (string[] args) {
-               return TestDriver.RunTests (typeof (Tests), args);
+               return TestDriver.RunTests (typeof (DevirtualizationTests), args);
        }
+#endif
        
        static public int test_0_sealed_class_devirt_right_method () {
                SealedFinal x = new SealedFinal ();
index aa5ca277ac544e5e57bdeffbbfd454a0c95de9ab..1e3ded9587a7d63ff7bdf25ad5024fc446fe7cb4 100644 (file)
@@ -1427,6 +1427,7 @@ class Tests
                return 0;
        }
 
+       [Category ("!WASM")] // reported as https://github.com/kripken/emscripten/issues/5603
        public static int test_0_simple_double_casts () {
 
                double d = 0xffffffff;
index 023a56d716507bda15dc1dc604531d94b82090eb..91234b6eec8da38a58334dc3a7f04e00c5ea9864 100644 (file)
@@ -7,12 +7,17 @@ using System.Threading;
 /*
  * Regression tests for the GC support in the JIT
  */
-
-class Tests {
-
-       static int Main () {
-               return TestDriver.RunTests (typeof (Tests));
-       }
+#if __MOBILE__
+class GcTests
+#else
+class Tests
+#endif
+{
+#if !__MOBILE__
+       public static int Main (string[] args) {
+               return TestDriver.RunTests (typeof (Tests), args);
+       }
+#endif
 
        public static int test_36_simple () {
                // Overflow the registers
@@ -525,9 +530,16 @@ class Tests {
                return 0;
        }
 
+       class ObjWithShiftOp {
+               public static ObjWithShiftOp operator >> (ObjWithShiftOp bi1, int shiftVal) {
+                       clobber_regs_and_gc ();
+                       return bi1;
+               }
+       }
+
        // Liveness for spill slots holding managed pointers
        public static int test_0_liveness_11 () {
-               Tests[] arr = new Tests [10];
+               ObjWithShiftOp[] arr = new ObjWithShiftOp [10];
                // This uses an ldelema internally
                // FIXME: This doesn't crash if mp-s are not correctly tracked, just writes to
                // an old object.
@@ -536,10 +548,6 @@ class Tests {
                return 0;
        }
 
-       public static Tests operator >> (Tests bi1, int shiftVal) {
-               clobber_regs_and_gc ();
-               return bi1;
-       }
 
        [MethodImplAttribute (MethodImplOptions.NoInlining)]
        public static void liveness_12_inner (int a, int b, int c, int d, int e, int f, object o, ref string s) {
index 42b91954fcf2c223e6c66a23fd404544ff3cb88b..412145683039727b6c053676cf346110372960a3 100644 (file)
@@ -3442,6 +3442,9 @@ ves_exec_method_with_context (InterpFrame *frame, ThreadContext *context, unsign
                        /* needed on arm64 */
                        if (isinf (sp [-1].data.f))
                                sp [-1].data.i = 0;
+                       /* needed by wasm */
+                       else if (isnan (sp [-1].data.f))
+                               sp [-1].data.i = 0;
                        else
                                sp [-1].data.i = (guint32)sp [-1].data.f;
                        ++ip;
index 6faca6d5b93e0fe7e50928fd7553011c74347d55..1868eb62c1024e74b43f95dd60d3930562ba25b5 100644 (file)
@@ -1155,7 +1155,11 @@ no_intrinsic:
                        return;
                } else {
                        /* mheader might not exist if this is a delegate invoc, etc */
-                       if (mheader && *mheader->code == CEE_RET && called_inited) {
+                       gboolean has_vt_arg = FALSE;
+                       for (i = 0; i < csignature->param_count; i++)
+                               has_vt_arg |= !mini_type_is_reference (csignature->params [i]);
+
+                       if (mheader && *mheader->code == CEE_RET && called_inited && !has_vt_arg) {
                                if (td->verbose_level)
                                        g_print ("Inline (empty) call of %s.%s\n", target_method->klass->name, target_method->name);
                                for (i = 0; i < csignature->param_count; i++) {
@@ -4258,6 +4262,7 @@ mono_interp_transform_init (void)
 MonoException *
 mono_interp_transform_method (InterpMethod *imethod, ThreadContext *context)
 {
+       MonoError error;
        int i, align, size, offset;
        MonoMethod *method = imethod->method;
        MonoImage *image = method->klass->image;
@@ -4275,9 +4280,11 @@ mono_interp_transform_method (InterpMethod *imethod, ThreadContext *context)
        MonoDomain *domain = imethod->domain;
 
        // g_printerr ("TRANSFORM(0x%016lx): begin %s::%s\n", mono_thread_current (), method->klass->name, method->name);
-       method_class_vt = mono_class_vtable (domain, imethod->method->klass);
+       method_class_vt = mono_class_vtable_full (domain, imethod->method->klass, &error);
+       if (!is_ok (&error))
+               return mono_error_convert_to_exception (&error);
+
        if (!method_class_vt->initialized) {
-               MonoError error;
                jmp_buf env;
                InterpFrame *last_env_frame = context->env_frame;
                jmp_buf *old_env = context->current_env;
@@ -4415,12 +4422,10 @@ mono_interp_transform_method (InterpMethod *imethod, ThreadContext *context)
                        break;
                case MonoInlineMethod:
                        if (method->wrapper_type == MONO_WRAPPER_NONE && *ip != CEE_CALLI) {
-                               m = mono_get_method_full (image, read32 (ip + 1), NULL, generic_context);
-                               if (m == NULL) {
+                               m = mono_get_method_checked (image, read32 (ip + 1), NULL, generic_context, &error);
+                               if (!is_ok (&error)) {
                                        g_free (is_bb_start);
-                                       g_error ("FIXME: where to get method and class string?"); 
-                                       return NULL;
-                                       // return mono_get_exception_missing_method ();
+                                       return mono_error_convert_to_exception (&error);
                                }
                                mono_class_init (m->klass);
                                if (!mono_class_is_interface (m->klass))
index 10cf1b75cb194d9051761962546b5ffba8b9f8f8..707951af02e15c807e7eccced069307a22af527b 100644 (file)
@@ -1415,6 +1415,11 @@ wrap_non_exception_throws (MonoMethod *m)
        int i;
        gboolean val = FALSE;
 
+       if (m->wrapper_type == MONO_WRAPPER_DYNAMIC_METHOD) {
+               MonoDynamicMethod *dm = (MonoDynamicMethod *)m;
+               if (dm->assembly)
+                       ass = dm->assembly;
+       }
        g_assert (ass);
        if (ass->wrap_non_exception_throws_inited)
                return ass->wrap_non_exception_throws;
@@ -3263,7 +3268,7 @@ mono_llvm_load_exception (void)
 
        if (mono_ex->trace_ips) {
                GList *trace_ips = NULL;
-               gpointer ip = RETURN_ADDRESS ();
+               gpointer ip = MONO_RETURN_ADDRESS ();
 
                size_t upper = mono_array_length (mono_ex->trace_ips);
 
index 88efb61d67b9a587edd702b6c4f0741a10bc048c..3f0540ff5fe527eeb7de9fe776ef5554110f5ae1 100644 (file)
@@ -352,6 +352,8 @@ mono_class_is_magic_assembly (MonoClass *klass)
        /* regression test suite */
        if (!strcmp ("builtin-types", klass->image->assembly_name))
                return TRUE;
+       if (!strcmp ("mini_tests", klass->image->assembly_name))
+               return TRUE;
        return FALSE;
 }
 
index b433a360d97e7a1cd83f9a9d7989b97105d05fb7..2eeb5f34d6e3de1fb09db5496e922816efd868ad 100644 (file)
@@ -3311,12 +3311,13 @@ mini_get_delegate_arg (MonoMethod *method, gpointer method_ptr)
 void
 mini_init_delegate (MonoDelegate *del)
 {
-       if (mono_llvm_only)
-               del->extra_arg = mini_get_delegate_arg (del->method, del->method_ptr);
 #ifdef ENABLE_INTERPRETER
        if (mono_use_interpreter)
                mono_interp_init_delegate (del);
+       else
 #endif
+       if (mono_llvm_only)
+               del->extra_arg = mini_get_delegate_arg (del->method, del->method_ptr);
 }
 
 char*
index 539125b2f387005ca812adf5d3d01d7c70e42f37..f8d052627cd72c45b10e5563471039bbb43eb0b9 100644 (file)
@@ -3274,22 +3274,22 @@ void mono_interruption_checkpoint_from_trampoline (void);
 
 #if defined (HOST_WASM)
 
-#define RETURN_ADDRESS_N(N) NULL
-#define RETURN_ADDRESS() RETURN_ADDRESS_N(0)
+#define MONO_RETURN_ADDRESS_N(N) NULL
+#define MONO_RETURN_ADDRESS() MONO_RETURN_ADDRESS_N(0)
 
 
 #elif defined (__GNUC__)
 
-#define RETURN_ADDRESS_N(N) (__builtin_extract_return_addr (__builtin_return_address (N)))
-#define RETURN_ADDRESS() RETURN_ADDRESS_N(0)
+#define MONO_RETURN_ADDRESS_N(N) (__builtin_extract_return_addr (__builtin_return_address (N)))
+#define MONO_RETURN_ADDRESS() MONO_RETURN_ADDRESS_N(0)
 
 #elif defined(_MSC_VER)
 
 #include <intrin.h>
 #pragma intrinsic(_ReturnAddress)
 
-#define RETURN_ADDRESS() _ReturnAddress()
-#define RETURN_ADDRESS_N(N) NULL
+#define MONO_RETURN_ADDRESS() _ReturnAddress()
+#define MONO_RETURN_ADDRESS_N(N) NULL
 
 #else
 
index 49e17ad14dd3ff89e2be6ecec526b15e041dcd6a..956a6310169bbee2492c869577ad25c580ba7a99 100644 (file)
@@ -338,11 +338,17 @@ namespace SSA {
                        return a;
                }
 
+#if __MOBILE__
+               public static test_2_old_test_suite () {
+                       return test1 (1);
+               }
+#else
                static int Main() {
                        if (test1 (1) != 2)
                                return 1;
                        return 0;
                }
+#endif
        }
 }
 
index b81fe604ed3aef345b7eef2ca52c01e4630172d7..3c916a941b3ddf62af09f0ed8db444584e76c84e 100644 (file)
@@ -416,7 +416,7 @@ mono_trace_enter_method (MonoMethod *method, char *ebp)
        g_free (fname);
 
        if (!ebp) {
-               printf (") ip: %p\n", RETURN_ADDRESS_N (1));
+               printf (") ip: %p\n", MONO_RETURN_ADDRESS_N (1));
                goto unlock;
        }
 
@@ -426,7 +426,7 @@ mono_trace_enter_method (MonoMethod *method, char *ebp)
 
        if (method->is_inflated) {
                /* FIXME: Might be better to pass the ji itself */
-               MonoJitInfo *ji = mini_jit_info_table_find (mono_domain_get (), (char *)RETURN_ADDRESS (), NULL);
+               MonoJitInfo *ji = mini_jit_info_table_find (mono_domain_get (), (char *)MONO_RETURN_ADDRESS (), NULL);
                if (ji) {
                        gsctx = mono_jit_info_get_generic_sharing_context (ji);
                        if (gsctx && gsctx->is_gsharedvt) {
@@ -590,7 +590,7 @@ mono_trace_leave_method (MonoMethod *method, ...)
 
        if (method->is_inflated) {
                /* FIXME: Might be better to pass the ji itself */
-               MonoJitInfo *ji = mini_jit_info_table_find (mono_domain_get (), (char *)RETURN_ADDRESS (), NULL);
+               MonoJitInfo *ji = mini_jit_info_table_find (mono_domain_get (), (char *)MONO_RETURN_ADDRESS (), NULL);
                if (ji) {
                        gsctx = mono_jit_info_get_generic_sharing_context (ji);
                        if (gsctx && gsctx->is_gsharedvt) {
@@ -698,7 +698,7 @@ mono_trace_leave_method (MonoMethod *method, ...)
                printf ("(unknown return type %x)", mono_method_signature (method)->ret->type);
        }
 
-       //printf (" ip: %p\n", RETURN_ADDRESS_N (1));
+       //printf (" ip: %p\n", MONO_RETURN_ADDRESS_N (1));
        printf ("\n");
        fflush (stdout);
 
index 5e8866ffff869d2123ece47d39040009b0a95118..47173bc29c959a8bd3ed8f1fc52c2d256959092f 100644 (file)
@@ -104,7 +104,7 @@ typedef mword SgenDescriptor;
 #endif
 #endif
 
-#if defined (TARGET_WASM)
+#if defined (HOST_WASM)
 #define DEFAULT_MAJOR SGEN_MAJOR_SERIAL
 #define DEFAULT_SWEEP_MODE SGEN_SWEEP_SERIAL
 #elif defined(HAVE_CONC_GC_AS_DEFAULT)
index d5416f0df3630ee6a6bc5b4781bc0e9c5442873c..4c3454823fdd42c2f5e0073a87f650601d6b84bf 100644 (file)
@@ -2503,7 +2503,7 @@ sgen_ensure_free_space (size_t size, int generation)
  * LOCKING: Assumes the GC lock is held.
  */
 void
-sgen_perform_collection (size_t requested_size, int generation_to_collect, const char *reason, gboolean wait_to_finish, gboolean stw)
+sgen_perform_collection_inner (size_t requested_size, int generation_to_collect, const char *reason, gboolean wait_to_finish, gboolean stw)
 {
        TV_DECLARE (gc_total_start);
        TV_DECLARE (gc_total_end);
@@ -2582,6 +2582,52 @@ sgen_perform_collection (size_t requested_size, int generation_to_collect, const
                sgen_restart_world (oldest_generation_collected);
 }
 
+#ifdef HOST_WASM
+
+typedef struct {
+       size_t requested_size;
+       int generation_to_collect;
+       const char *reason;
+} SgenGcRequest;
+
+static SgenGcRequest gc_request;
+static gboolean pending_request;
+
+extern void request_gc_cycle (void);
+
+#include <emscripten.h>
+
+EMSCRIPTEN_KEEPALIVE void
+mono_gc_pump_callback (void)
+{
+       if (!pending_request)
+               return;
+       pending_request = FALSE;
+       sgen_perform_collection_inner (gc_request.requested_size, gc_request.generation_to_collect, gc_request.reason, TRUE, TRUE);     
+}
+#endif
+
+void
+sgen_perform_collection (size_t requested_size, int generation_to_collect, const char *reason, gboolean wait_to_finish, gboolean stw)
+{
+#ifdef HOST_WASM
+       g_assert (stw); //can't handle non-stw mode (IE, domain unload)
+       //we ignore wait_to_finish
+       if (!pending_request || gc_request.generation_to_collect <= generation_to_collect) { //no active request or request was for a smaller part of the heap
+               gc_request.requested_size = requested_size;
+               gc_request.generation_to_collect = generation_to_collect;
+               gc_request.reason = reason;
+               if (!pending_request) {
+                       request_gc_cycle ();
+                       pending_request = TRUE;
+               }
+       }
+
+       degraded_mode = 1; //enable degraded mode so allocation can continue
+#else
+       sgen_perform_collection_inner (requested_size, generation_to_collect, reason, wait_to_finish, stw);
+#endif
+}
 /*
  * ######################################################################
  * ########  Memory allocation from the OS
index e769cf22bb5269e0fc8cffd2b6f009b4cf16b912..67db79c7fe63b3729025e8fe7e314002805a8ce8 100644 (file)
@@ -3,7 +3,7 @@ import fileinput
 class MSBuild (GitHubPackage):
        def __init__ (self):
                GitHubPackage.__init__ (self, 'mono', 'msbuild', '15.4',
-                       revision = '8b76a1d2b9ffc493349a861962e44540ea14eaac')
+                       revision = '5bb588162eadfc68c6af8895397f4f65f8008b24')
 
        def build (self):
                self.sh ('./cibuild.sh --scope Compile --target Mono --host Mono --config Release')