[mini] Add new JIT flag JIT_FLAG_DISCARD_RESULTS to reduce the noise when profiling...
authorRodrigo Kumpera <kumpera@users.noreply.github.com>
Thu, 19 Jan 2017 11:34:50 +0000 (03:34 -0800)
committerZoltan Varga <vargaz@gmail.com>
Thu, 19 Jan 2017 11:34:50 +0000 (06:34 -0500)
JI registration dominates profiling as it has some perf issues itself.

mono/mini/driver.c
mono/mini/mini.c
mono/mini/mini.h

index 590607889fdd5451339d89c61b2e420cc90de2d8..da2033e5e8c97e613bda1fddc8b6fea7d4c2af10 100644 (file)
@@ -956,7 +956,7 @@ compile_all_methods_thread_main_inner (CompileAllThreadArgs *args)
                        g_print ("Compiling %d %s\n", count, desc);
                        g_free (desc);
                }
-               cfg = mini_method_compile (method, mono_get_optimizations_for_method (method, args->opts), mono_get_root_domain (), (JitFlags)0, 0, -1);
+               cfg = mini_method_compile (method, mono_get_optimizations_for_method (method, args->opts), mono_get_root_domain (), (JitFlags)JIT_FLAG_DISCARD_RESULTS, 0, -1);
                if (cfg->exception_type != MONO_EXCEPTION_NONE) {
                        printf ("Compilation of %s failed with exception '%s':\n", mono_method_full_name (cfg->method, TRUE), cfg->exception_message);
                        fail_count ++;
index 88dc3a514c77e8bdcfe967f706e57563530e44bd..e770092c95a5225e86fc49a19f6544909194af33 100644 (file)
@@ -3895,7 +3895,7 @@ mini_method_compile (MonoMethod *method, guint32 opts, MonoDomain *domain, JitFl
                g_free (id);
        }
 
-       if (!cfg->compile_aot) {
+       if (!cfg->compile_aot && !(flags & JIT_FLAG_DISCARD_RESULTS)) {
                mono_domain_lock (cfg->domain);
                mono_jit_info_table_add (cfg->domain, cfg->jit_info);
 
index 568caffb40d89a28a3070712e7206d3a5ace6cdb..ce69a99fdcf503bfeb5ec8f374c53ff2e2676b9a 100644 (file)
@@ -1527,7 +1527,9 @@ typedef enum {
        /* Whenever to compile in llvm-only mode */
        JIT_FLAG_LLVM_ONLY = (1 << 6),
        /* Whenever calls to pinvoke functions are made directly */
-       JIT_FLAG_DIRECT_PINVOKE = (1 << 7)
+       JIT_FLAG_DIRECT_PINVOKE = (1 << 7),
+       /* Whenever this is a compile-all run and the result should be discarded */
+       JIT_FLAG_DISCARD_RESULTS = (1 << 8),
 } JitFlags;
 
 /* Bit-fields in the MonoBasicBlock.region */