diff options
author | Zoltan Varga <vargaz@gmail.com> | 2013-03-25 05:47:26 +0400 |
---|---|---|
committer | Zoltan Varga <vargaz@gmail.com> | 2013-03-25 05:54:39 +0400 |
commit | ec5503773f9363a6e0304971fb0e2c8d1640ca3b (patch) | |
tree | b4e45343a8f2ed014506dcffbf1ab4746d64995f | |
parent | b354c6268d8694d741542a7a89d8860b31afd22f (diff) |
Fix the hashing of MonoJumpInfo structures, previously many had the same hash code.
-rw-r--r-- | mono/mini/aot-compiler.c | 6 | ||||
-rw-r--r-- | mono/mini/mini.c | 25 |
2 files changed, 28 insertions, 3 deletions
diff --git a/mono/mini/aot-compiler.c b/mono/mini/aot-compiler.c index 59b178b2b08..55fd1e6fe09 100644 --- a/mono/mini/aot-compiler.c +++ b/mono/mini/aot-compiler.c @@ -2841,8 +2841,6 @@ get_plt_entry (MonoAotCompile *acfg, MonoJumpInfo *patch_info) new_ji = mono_patch_info_dup_mp (acfg->mempool, patch_info); - // g_assert (mono_patch_info_equal (patch_info, new_ji)); - res = mono_mempool_alloc0 (acfg->mempool, sizeof (MonoPltEntry)); res->plt_offset = acfg->plt_offset; res->ji = new_ji; @@ -2858,6 +2856,10 @@ get_plt_entry (MonoAotCompile *acfg, MonoJumpInfo *patch_info) g_hash_table_insert (acfg->plt_offset_to_entry, GUINT_TO_POINTER (res->plt_offset), res); + //g_assert (mono_patch_info_equal (patch_info, new_ji)); + //mono_print_ji (patch_info); printf ("\n"); + //g_hash_table_print_stats (acfg->patch_to_plt_entry); + acfg->plt_offset ++; } diff --git a/mono/mini/mini.c b/mono/mini/mini.c index 8c729b8e5d6..88d6bd834e0 100644 --- a/mono/mini/mini.c +++ b/mono/mini/mini.c @@ -2983,19 +2983,42 @@ mono_patch_info_hash (gconstpointer data) case MONO_PATCH_INFO_IID: case MONO_PATCH_INFO_ADJUSTED_IID: case MONO_PATCH_INFO_CLASS_INIT: + case MONO_PATCH_INFO_GENERIC_CLASS_INIT: case MONO_PATCH_INFO_METHODCONST: case MONO_PATCH_INFO_METHOD: case MONO_PATCH_INFO_METHOD_JUMP: case MONO_PATCH_INFO_IMAGE: case MONO_PATCH_INFO_JIT_ICALL_ADDR: + case MONO_PATCH_INFO_ICALL_ADDR: case MONO_PATCH_INFO_FIELD: case MONO_PATCH_INFO_SFLDA: case MONO_PATCH_INFO_SEQ_POINT_INFO: + case MONO_PATCH_INFO_METHOD_RGCTX: + case MONO_PATCH_INFO_DELEGATE_TRAMPOLINE: + case MONO_PATCH_INFO_SIGNATURE: return (ji->type << 8) | (gssize)ji->data.target; case MONO_PATCH_INFO_GSHAREDVT_CALL: return (ji->type << 8) | (gssize)ji->data.gsharedvt->method; - default: + case MONO_PATCH_INFO_RGCTX_FETCH: { + MonoJumpInfoRgctxEntry *e = ji->data.rgctx_entry; + + return (ji->type << 8) | (gssize)e->method | (e->in_mrgctx) | e->info_type | mono_patch_info_hash (e->data); + } + case MONO_PATCH_INFO_INTERRUPTION_REQUEST_FLAG: + case MONO_PATCH_INFO_MSCORLIB_GOT_ADDR: + case MONO_PATCH_INFO_GC_CARD_TABLE_ADDR: + case MONO_PATCH_INFO_JIT_TLS_ID: + case MONO_PATCH_INFO_MONITOR_ENTER: + case MONO_PATCH_INFO_MONITOR_EXIT: + case MONO_PATCH_INFO_CASTCLASS_CACHE: return (ji->type << 8); + case MONO_PATCH_INFO_SWITCH: + return (ji->type << 8) | ji->data.table->table_size; + default: + printf ("info type: %d\n", ji->type); + mono_print_ji (ji); printf ("\n"); + g_assert_not_reached (); + return 0; } } |