[interp] Fix interp logging (mono/mono#17636)
authorVlad Brezae <brezaevlad@gmail.com>
Thu, 31 Oct 2019 13:32:50 +0000 (15:32 +0200)
committerGitHub <noreply@github.com>
Thu, 31 Oct 2019 13:32:50 +0000 (15:32 +0200)
* [interp] Don't print NOPs during cprop

They can become numerous and distracting.

* [interp] Fix mono_interp_print_code

Regressed after code_size was changed to byte count instead of short count.

Commit migrated from https://github.com/mono/mono/commit/1d043a31e7d207739f81b303b7ee2c79ed135859

src/mono/mono/mini/interp/transform.c

index 81d9dd3..5bd9f54 100644 (file)
@@ -1039,7 +1039,7 @@ void
 mono_interp_print_code (InterpMethod *imethod)
 {
        MonoJitInfo *jinfo = imethod->jinfo;
-       const guint16 *start;
+       const guint8 *start;
 
        if (!jinfo)
                return;
@@ -1048,8 +1048,8 @@ mono_interp_print_code (InterpMethod *imethod)
        g_print ("Method : %s\n", name);
        g_free (name);
 
-       start = (guint16*) jinfo->code_start;
-       dump_mint_code (start, start + jinfo->code_size);
+       start = (guint8*) jinfo->code_start;
+       dump_mint_code ((const guint16*)start, (const guint16*)(start + jinfo->code_size));
 }
 
 
@@ -6896,7 +6896,7 @@ retry:
                }
                // The instruction pops some values then pushes some other
                get_inst_stack_usage (td, ins, &pop, &push);
-               if (td->verbose_level) {
+               if (td->verbose_level && ins->opcode != MINT_NOP) {
                        dump_interp_inst (ins);
                        g_print (", sp %d, (pop %d, push %d)\n", sp - stack, pop, push);
                }