Merge pull request #5224 from alexrp/profiler-multiple-args
authorAlex Rønne Petersen <alex@alexrp.com>
Tue, 18 Jul 2017 22:39:40 +0000 (00:39 +0200)
committerGitHub <noreply@github.com>
Tue, 18 Jul 2017 22:39:40 +0000 (00:39 +0200)
[profiler] Better support for multiple profilers.

acceptance-tests/profiler-stress/runner.cs
mcs/class/System.Net.Http/System.Net.Http/HttpClientHandler.cs
mono/mini/aot-runtime.c
mono/mini/mini-llvm.c
mono/mini/mini.c
mono/sgen/sgen-marksweep.c
packaging/MacSDK/msbuild.py
tools/offsets-tool/MonoAotOffsetsDumper.cs

index ce35b9a4b05632a0530d30f7bc6847deca5b1c44..3cb7ad2a33311855e198e481aa6a615fb4eea604 100644 (file)
@@ -57,7 +57,7 @@ namespace Mono.Profiling.Tests.Stress {
                        "jit",
                };
 
-               static readonly TimeSpan _timeout = TimeSpan.FromHours (6);
+               static readonly TimeSpan _timeout = TimeSpan.FromHours (8);
 
                static string FilterInvalidXmlChars (string text) {
                        return Regex.Replace (text, @"[^\x09\x0A\x0D\x20-\uD7FF\uE000-\uFFFD\u10000-\u10FFFF]", string.Empty);
index 4aeaf50cd931ec9a513c0d4da69bb30f1bfe1e15..8ea06b162bc4fd841e3be8a83440ca836763553a 100644 (file)
@@ -375,8 +375,9 @@ namespace System.Net.Http
 
                                                wrequest.ResendContentFactory = content.CopyTo;
 
-                                               var stream = await wrequest.GetRequestStreamAsync ().ConfigureAwait (false);
-                                               await request.Content.CopyToAsync (stream).ConfigureAwait (false);
+                                               using (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)) {
                                                // Explicitly set this to make sure we're sending a "Content-Length: 0" header.
                                                // This fixes the issue that's been reported on the forums:
index 7b28d8db4a28bc9c6df49dd5a331c5c54216c924..55624a6b1219b16eabdb3172e99b0a7f0e7fd426 100644 (file)
@@ -3005,6 +3005,7 @@ decode_exception_debug_info (MonoAotModule *amodule, MonoDomain *domain,
                                g_slist_free (nesting [i]);
                        g_free (nesting);
                }
+               jinfo->from_llvm = 1;
        } else {
                len = mono_jit_info_size (flags, num_clauses, num_holes);
                jinfo = (MonoJitInfo *)alloc0_jit_info_data (domain, len, async);
index 81c12dfe7791ff0966b6abe23793d80842b6e167..bdcbd9ca72a02314cc27213ae86e98cc49def13c 100644 (file)
@@ -7113,19 +7113,6 @@ emit_method_inner (EmitContext *ctx)
                }
        }
 
-       /*
-        * The INDIRECT flag added by OP_LDADDR inhibits optimizations, even if the LDADDR
-        * was later optimized away, so clear these flags, and add them back for the still
-        * present OP_LDADDR instructions.
-        */
-       for (i = 0; i < cfg->next_vreg; ++i) {
-               MonoInst *ins;
-
-               ins = get_vreg_to_inst (cfg, i);
-               if (ins && ins != cfg->rgctx_var)
-                       ins->flags &= ~MONO_INST_INDIRECT;
-       }
-
        /*
         * Make a first pass over the code to precreate PHI nodes/set INDIRECT flags.
         */
index 9948d16c14554277b1c313c217a664b2676a4ca5..99f0755dd05679cea2fc4c2f3d52d5b67fd33deb 100644 (file)
@@ -2077,8 +2077,11 @@ mono_compile_create_vars (MonoCompile *cfg)
        if (cfg->verbose_level > 2)
                g_print ("creating locals\n");
 
-       for (i = 0; i < header->num_locals; ++i)
+       for (i = 0; i < header->num_locals; ++i) {
+               if (cfg->verbose_level > 2)
+                       g_print ("\tlocal [%d]: ", i);
                cfg->locals [i] = mono_compile_create_var (cfg, header->locals [i], OP_LOCAL);
+       }
 
        if (cfg->verbose_level > 2)
                g_print ("locals done\n");
index 2d1bc5b279917b626d7615ea89d0c5ca305d7f7c..04feb680f2d77b9f6b239c0046cf4abf165cb589 100644 (file)
@@ -2137,7 +2137,7 @@ major_free_swept_blocks (size_t section_reserve)
 {
        SGEN_ASSERT (0, sweep_state == SWEEP_STATE_SWEPT, "Sweeping must have finished before freeing blocks");
 
-#ifdef TARGET_WIN32
+#if defined(HOST_WIN32) || defined(HOST_ORBIS)
                /*
                 * sgen_free_os_memory () asserts in mono_vfree () because windows doesn't like freeing the middle of
                 * a VirtualAlloc ()-ed block.
index b02ac199983bc741ea2ab05cddcbe5bda96e7ed0..d3623d1d44402d20bf3c097d181b203a92005893 100644 (file)
@@ -3,7 +3,7 @@ import fileinput
 class MSBuild (GitHubPackage):
        def __init__ (self):
                GitHubPackage.__init__ (self, 'mono', 'msbuild', '15.3',
-                       revision = 'f7dcc3900c808775adad970f047202b4de34e986')
+                       revision = '9fcd43ddc7c2f9b250b0d7e823ae01862246b35a')
 
        def build (self):
                self.sh ('./cibuild.sh --scope Compile --target Mono --host Mono --config Release')
index 0775292a10665800551ee99ffbbc20a515efa8bd..94622793145f8d5ff85b0a5918b04cc3797ef81a 100644 (file)
@@ -28,6 +28,7 @@ namespace CppSharp
         static string AndroidNdkPath = @"";
         static string MaccoreDir = @"";
         static string TargetDir = @"";
+        static bool GenIOS;
 
         public enum TargetPlatform
         {
@@ -206,7 +207,7 @@ namespace CppSharp
                 MaccoreDir = Path.Combine (maccoreDir);
             }
 
-            if (Directory.Exists(MaccoreDir))
+            if (Directory.Exists(MaccoreDir) || GenIOS)
                 SetupiOSTargets();
 
             foreach (var target in Targets)
@@ -244,6 +245,7 @@ namespace CppSharp
 
                 source.Options.AddDefines ("HAVE_SGEN_GC");
                 source.Options.AddDefines ("HAVE_MOVING_COLLECTOR");
+                source.Options.AddDefines("MONO_GENERATING_OFFSETS");
             }
         }
 
@@ -274,6 +276,7 @@ namespace CppSharp
                 { "android-ndk=", "Path to Android NDK", v => AndroidNdkPath = v },
                 { "targetdir=", "Path to the directory containing the mono build", v =>TargetDir = v },
                 { "mono=", "include directory", v => MonoDir = v },
+                { "gen-ios", "generate iOS offsets", v => GenIOS != null },
                 { "h|help",  "show this message and exit",  v => showHelp = v != null },
             };
 
@@ -307,6 +310,7 @@ namespace CppSharp
             parserOptions.AddArguments("-xc");
             parserOptions.AddArguments("-std=gnu99");
             parserOptions.AddDefines("CPPSHARP");
+            parserOptions.AddDefines("MONO_GENERATING_OFFSETS");
 
             foreach (var define in target.Defines)
                 parserOptions.AddDefines(define);