Merge pull request #601 from knocte/sock_improvements
[mono.git] / mono / mini / mini-codegen.c
index be4b65fcdfa47daa5bf47301cdc1f8602dd0fa84..8ef772a1b14c82c2c139ba05f0ea329e46bc9b16 100644 (file)
@@ -410,6 +410,37 @@ typedef struct {
 } RegTrack;
 
 #ifndef DISABLE_LOGGING
+
+static const char* const patch_info_str[] = {
+#define PATCH_INFO(a,b) "" #a,
+#include "patch-info.h"
+#undef PATCH_INFO
+};
+
+void
+mono_print_ji (const MonoJumpInfo *ji)
+{
+       switch (ji->type) {
+       case MONO_PATCH_INFO_RGCTX_FETCH: {
+               MonoJumpInfoRgctxEntry *entry = ji->data.rgctx_entry;
+
+               printf ("[RGCTX_FETCH ");
+               mono_print_ji (entry->data);
+               printf (" - %s]", mono_rgctx_info_type_to_str (entry->info_type));
+               break;
+       }
+       case MONO_PATCH_INFO_METHODCONST: {
+               char *s = mono_method_full_name (ji->data.method, TRUE);
+               printf ("[METHODCONST - %s]", s);
+               g_free (s);
+               break;
+       }
+       default:
+               printf ("[%s]", patch_info_str [ji->type]);
+               break;
+       }
+}
+
 void
 mono_print_ins_index (int i, MonoInst *ins)
 {
@@ -532,6 +563,7 @@ mono_print_ins_index (int i, MonoInst *ins)
        case OP_IAND_IMM:
        case OP_IOR_IMM:
        case OP_IXOR_IMM:
+       case OP_SUB_IMM:
                printf (" [%d]", (int)ins->inst_imm);
                break;
        case OP_ADD_IMM:
@@ -581,6 +613,11 @@ mono_print_ins_index (int i, MonoInst *ins)
                        char *full_name = mono_method_full_name (call->method, TRUE);
                        printf (" [%s]", full_name);
                        g_free (full_name);
+               } else if (call->fptr_is_patch) {
+                       MonoJumpInfo *ji = (MonoJumpInfo*)call->fptr;
+
+                       printf (" ");
+                       mono_print_ji (ji);
                } else if (call->fptr) {
                        MonoJitICallInfo *info = mono_find_jit_icall_by_addr (call->fptr);
                        if (info)
@@ -668,6 +705,12 @@ print_regtrack (RegTrack *t, int num)
        }
 }
 #else
+
+void
+mono_print_ji (const MonoJumpInfo *ji)
+{
+}
+
 void
 mono_print_ins_index (int i, MonoInst *ins)
 {