Author: zoltan
Date: 2007-02-28 09:09:09 -0500 (Wed, 28 Feb 2007)
New Revision: 73549

Modified:
   branches/vargaz/mini-linear-il/mono/mono/mini/ChangeLog
   branches/vargaz/mini-linear-il/mono/mono/mini/local-propagation.c
   branches/vargaz/mini-linear-il/mono/mono/mini/method-to-ir.c
   branches/vargaz/mini-linear-il/mono/mono/mini/mini-amd64.c
   branches/vargaz/mini-linear-il/mono/mono/mini/mini.c
Log:
Merge from HEAD

Modified: branches/vargaz/mini-linear-il/mono/mono/mini/ChangeLog
===================================================================
--- branches/vargaz/mini-linear-il/mono/mono/mini/ChangeLog     2007-02-28 
14:08:36 UTC (rev 73548)
+++ branches/vargaz/mini-linear-il/mono/mono/mini/ChangeLog     2007-02-28 
14:09:09 UTC (rev 73549)
@@ -14,6 +14,18 @@
 
        * method-to-ir.c (mini_emit_class_check): New helper function.
 
+       * mini-amd64.c (peephole_pass): Optimize code common in initlocals 
blocks.
+
+       * mini.h (NULLIFY_INS): New macro.
+
+Tue Jan 30 16:33:33 CET 2007 Paolo Molaro <[EMAIL PROTECTED]>
+
+       * mini.c: statistical profiler fix for windows, patch
+       from Tor Lillqvist ([EMAIL PROTECTED]).
+
+2007-01-30  Massimiliano Mantione  <[EMAIL PROTECTED]>
+       * local-propagation.c: Fix bug 80591.
+
 Mon Jan 29 12:14:34 CET 2007 Paolo Molaro <[EMAIL PROTECTED]>
 
        * Makefile.am: put back the --export-dynamic option as with

Modified: branches/vargaz/mini-linear-il/mono/mono/mini/local-propagation.c
===================================================================
--- branches/vargaz/mini-linear-il/mono/mono/mini/local-propagation.c   
2007-02-28 14:08:36 UTC (rev 73548)
+++ branches/vargaz/mini-linear-il/mono/mono/mini/local-propagation.c   
2007-02-28 14:09:09 UTC (rev 73549)
@@ -493,7 +493,11 @@
                                *tree = *cp;
                        }
                } else {
-                       if ((tree->inst_i0->inst_vtype->type == 
cp->inst_vtype->type) ||
+                       //MonoType *inst_i0_underlying_type = 
mono_type_get_underlying_type (tree->inst_i0->inst_vtype);
+                       //MonoType *cp_underlying_type = 
mono_type_get_underlying_type (cp->inst_vtype);
+                       MonoType *inst_i0_underlying_type = 
(tree->inst_i0->inst_vtype);
+                       MonoType *cp_underlying_type = (cp->inst_vtype);
+                       if ((inst_i0_underlying_type->type == 
cp_underlying_type->type) ||
                            (tree->type == STACK_OBJ) || (tree->type == 
STACK_MP)) {
                                if (cfg->opt & MONO_OPT_COPYPROP) {
                                        //{ static int c = 0; printf ("VCOPY 
%d\n", ++c); }

Modified: branches/vargaz/mini-linear-il/mono/mono/mini/method-to-ir.c
===================================================================
--- branches/vargaz/mini-linear-il/mono/mono/mini/method-to-ir.c        
2007-02-28 14:08:36 UTC (rev 73548)
+++ branches/vargaz/mini-linear-il/mono/mono/mini/method-to-ir.c        
2007-02-28 14:09:09 UTC (rev 73549)
@@ -10027,7 +10027,7 @@
  *   parts of the tree could be separated by other instructions, killing the 
tree
  *   arguments, or stores killing loads etc. Also, should we fold loads into 
other
  *   instructions if the result of the load is used multiple times ?
- * - LAST MERGE: 71900.
+ * - LAST MERGE: 72000.
  */
 
 /*

Modified: branches/vargaz/mini-linear-il/mono/mono/mini/mini-amd64.c
===================================================================
--- branches/vargaz/mini-linear-il/mono/mono/mini/mini-amd64.c  2007-02-28 
14:08:36 UTC (rev 73548)
+++ branches/vargaz/mini-linear-il/mono/mono/mini/mini-amd64.c  2007-02-28 
14:09:09 UTC (rev 73549)
@@ -1935,7 +1935,34 @@
                                 */
                                ins->opcode = OP_X86_LEA_MEMBASE;
                                ins->inst_basereg = ins->sreg1;
+                               /* Fall through */
                        }
+                       else
+                               break;
+               case CEE_XOR:
+                       if ((ins->sreg1 == ins->sreg2) && (ins->sreg1 == 
ins->dreg)) {
+                               MonoInst *ins2;
+
+                               /* 
+                                * Replace STORE_MEMBASE_IMM 0 with 
STORE_MEMBASE_REG since 
+                                * the latter has length 2-3 instead of 6 
(reverse constant
+                                * propagation). These instruction sequences 
are very common
+                                * in the initlocals bblock.
+                                */
+                               for (ins2 = ins->next; ins2; ins2 = ins2->next) 
{
+                                       if (((ins2->opcode == 
OP_STORE_MEMBASE_IMM) || (ins2->opcode == OP_STOREI4_MEMBASE_IMM) || 
(ins2->opcode == OP_STOREI8_MEMBASE_IMM) || (ins2->opcode == 
OP_STORE_MEMBASE_IMM)) && (ins2->inst_imm == 0)) {
+                                               ins2->opcode = 
store_membase_imm_to_store_membase_reg (ins2->opcode);
+                                               ins2->sreg1 = ins->dreg;
+                                       } else if ((ins2->opcode == 
OP_STOREI1_MEMBASE_IMM) || (ins2->opcode == OP_STOREI2_MEMBASE_IMM) || 
(ins2->opcode == OP_STOREI8_MEMBASE_REG) || (ins2->opcode == 
OP_STORE_MEMBASE_REG)) {
+                                               /* Continue */
+                                       } else if (((ins2->opcode == OP_ICONST) 
|| (ins2->opcode == OP_I8CONST)) && (ins2->dreg == ins->dreg) && (ins2->inst_c0 
== 0)) {
+                                               NULLIFY_INS (ins2);
+                                               /* Continue */
+                                       } else {
+                                               break;
+                                       }
+                               }
+                       }
                        break;
                case OP_SUB_IMM:
                case OP_ISUB_IMM:
@@ -3882,7 +3909,13 @@
                case OP_LABEL:
                        ins->inst_c0 = code - cfg->native_code;
                        break;
+<<<<<<< .working
                case OP_BR:
+=======
+               case CEE_NOP:
+                       break;
+               case CEE_BR:
+>>>>>>> .merge-right.r72000
                        //g_print ("target: %p, next: %p, curr: %p, last: 
%p\n", ins->inst_target_bb, bb->next_bb, ins, bb->last_ins);
                        //if ((ins->inst_target_bb == bb->next_bb) && ins == 
bb->last_ins)
                        //break;

Modified: branches/vargaz/mini-linear-il/mono/mono/mini/mini.c
===================================================================
--- branches/vargaz/mini-linear-il/mono/mono/mini/mini.c        2007-02-28 
14:08:36 UTC (rev 73548)
+++ branches/vargaz/mini-linear-il/mono/mono/mini/mini.c        2007-02-28 
14:09:09 UTC (rev 73549)
@@ -22,6 +22,10 @@
 #include <pthread.h>
 #endif
 
+#ifdef PLATFORM_WIN32
+#define _WIN32_WINNT 0x0500
+#endif
+
 #ifdef HAVE_VALGRIND_MEMCHECK_H
 #include <valgrind/memcheck.h>
 #endif
@@ -11975,6 +11979,8 @@
        mono_arch_handle_exception (ctx, exc, FALSE);
 }
 
+#ifndef PLATFORM_WIN32
+
 static void
 SIG_HANDLER_SIGNATURE (sigabrt_signal_handler)
 {
@@ -12045,6 +12051,16 @@
 }
 
 static void
+SIG_HANDLER_SIGNATURE (sigusr2_signal_handler)
+{
+       gboolean enabled = mono_trace_is_enabled ();
+
+       mono_trace_enable (!enabled);
+}
+
+#endif
+
+static void
 SIG_HANDLER_SIGNATURE (sigint_signal_handler)
 {
        MonoException *exc;
@@ -12055,14 +12071,6 @@
        mono_arch_handle_exception (ctx, exc, FALSE);
 }
 
-static void
-SIG_HANDLER_SIGNATURE (sigusr2_signal_handler)
-{
-       gboolean enabled = mono_trace_is_enabled ();
-
-       mono_trace_enable (!enabled);
-}
-
 #ifdef PLATFORM_MACOSX
 
 /*
@@ -12316,6 +12324,21 @@
 }
 #endif
 
+#ifdef PLATFORM_WIN32
+static HANDLE win32_main_thread;
+static MMRESULT win32_timer;
+
+static void CALLBACK
+win32_time_proc (UINT uID, UINT uMsg, DWORD dwUser, DWORD dw1, DWORD dw2)
+{
+       CONTEXT context;
+
+       context.ContextFlags = CONTEXT_CONTROL;
+       if (GetThreadContext (win32_main_thread, &context))
+               mono_profiler_stat_hit ((guchar *) context.Eip, &context);
+}
+#endif
+
 static void
 setup_stat_profiler (void)
 {
@@ -12368,6 +12391,27 @@
                return;
        inited = 1;
        add_signal_handler (SIGPROF, sigprof_signal_handler);
+#elif defined (PLATFORM_WIN32)
+       static int inited = 0;
+       TIMECAPS timecaps;
+
+       if (inited)
+               return;
+
+       inited = 1;
+       if (timeGetDevCaps (&timecaps, sizeof (timecaps)) != TIMERR_NOERROR)
+               return;
+
+       if ((win32_main_thread = OpenThread (READ_CONTROL | THREAD_GET_CONTEXT, 
FALSE, GetCurrentThreadId ())) == NULL)
+               return;
+
+       if (timeBeginPeriod (1) != TIMERR_NOERROR)
+               return;
+
+       if ((win32_timer = timeSetEvent (1, 0, win32_time_proc, 0, 
TIME_PERIODIC)) == 0) {
+               timeEndPeriod (1);
+               return;
+       }
 #endif
 }
 

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to