2008-10-16 Martin Baulig <martin@ximian.com>
authorMartin Baulig <martin@novell.com>
Thu, 16 Oct 2008 15:36:54 +0000 (15:36 -0000)
committerMartin Baulig <martin@novell.com>
Thu, 16 Oct 2008 15:36:54 +0000 (15:36 -0000)
* mini-ops.h, cpu-amd64.md, cpu-x86.md: Added new `hard_nop' opcode.

* inssel.brg: Add `OP_HARD_NOP'.

* mini.h (MonoCompile): Added `keep_cil_nops' flag.

* mini.c (mono_method_to_ir): In `CEE_NOP': generate a
`OP_HARD_NOP' instruction when running inside the debugger.

* method-to-ir.c (mono_method_to_ir2): In `CEE_NOP': generate a
`OP_HARD_NOP' instruction when running inside the debugger.

svn path=/trunk/mono/; revision=116007

mono/mini/ChangeLog
mono/mini/method-to-ir.c
mono/mini/mini.c
mono/mini/mini.h

index 438e20dbe5658cabe5bb0dad33a1dd1e7ff0b9ac..732127a1ac1c27af11d7e6f4f4e799ffa45555d8 100644 (file)
@@ -4,8 +4,13 @@
 
        * inssel.brg: Add `OP_HARD_NOP'.
 
-       * mini.c: In `CEE_NOP': generate a `OP_HARD_NOP' instruction
-       when running inside the debugger.
+       * mini.h (MonoCompile): Added `keep_cil_nops' flag.
+
+       * mini.c (mono_method_to_ir): In `CEE_NOP': generate a
+       `OP_HARD_NOP' instruction when running inside the debugger.
+
+       * method-to-ir.c (mono_method_to_ir2): In `CEE_NOP': generate a
+       `OP_HARD_NOP' instruction when running inside the debugger.
 
 2008-10-15  Rodrigo Kumpera  <rkumpera@novell.com>
 
index 00c45e81e4eeae1e8d38b705b63905d5ab367357..44b0b66facec67a545839f67026376eb83f98469 100644 (file)
@@ -5067,6 +5067,9 @@ mono_method_to_ir2 (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_
        if (!dont_verify && mini_method_verify (cfg, method_definition))
                goto exception_exit;
 
+       if (mono_debug_using_mono_debugger ())
+               cfg->keep_cil_nops = TRUE;
+
        if (sig->is_inflated)
                generic_context = mono_method_get_context (method);
        else if (generic_container)
@@ -5456,8 +5459,15 @@ mono_method_to_ir2 (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_
 
                switch (*ip) {
                case CEE_NOP:
+                       if (cfg->keep_cil_nops)
+                               MONO_INST_NEW (cfg, ins, OP_HARD_NOP);
+                       else
+                               MONO_INST_NEW (cfg, ins, OP_NOP);
+                       ip++;
+                       MONO_ADD_INS (bblock, ins);
+                       break;
                case CEE_BREAK:
-                       MONO_INST_NEW (cfg, ins, (*ip) == CEE_NOP ? OP_NOP : OP_BREAK);
+                       MONO_INST_NEW (cfg, ins, OP_BREAK);
                        ip++;
                        MONO_ADD_INS (bblock, ins);
                        break;
index 22141ec35a2e682239b16c13f715cbc64bd0f0bd..6583f2cdbf177f6d517295b5229ea300702d0e99 100644 (file)
@@ -5233,7 +5233,6 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
        MonoDeclSecurityActions actions;
        GSList *class_inits = NULL;
        gboolean dont_verify, dont_verify_stloc, readonly = FALSE;
-       gboolean use_hard_nops = FALSE;
        int context_used;
 
        /* serialization and xdomain stuff may need access to private fields and methods */
@@ -5278,7 +5277,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
                goto exception_exit;
 
        if (mono_debug_using_mono_debugger ())
-               use_hard_nops = TRUE;
+               cfg->keep_cil_nops = TRUE;
 
        if (sig->is_inflated)
                generic_context = mono_method_get_context (method);
@@ -5687,7 +5686,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
 
                switch (*ip) {
                case CEE_NOP:
-                       if (use_hard_nops)
+                       if (cfg->keep_cil_nops)
                                MONO_INST_NEW (cfg, ins, OP_HARD_NOP);
                        else
                                MONO_INST_NEW (cfg, ins, OP_NOP);
index 307f00b7159ca96197ae23123d4a522087d96dee..68ef312856b9b668106a31416669e96d4863cd73 100644 (file)
@@ -940,6 +940,7 @@ typedef struct {
        guint            uses_rgctx_reg : 1;
        guint            uses_vtable_reg : 1;
        guint            uses_simd_intrinsics : 1;
+       guint            keep_cil_nops : 1;
        gpointer         debug_info;
        guint32          lmf_offset;
     guint16          *intvars;