X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mono%2Fmini%2Fseq-points.c;h=f9c0b1f00ececf4f302467b0bd3ea89c981a44b7;hb=fb48a088ce55f95c522ddbd02a0efc74f765c56e;hp=899544d1c02de3e8c90760af621a74f899d64438;hpb=d22f93ffa66b1ba35d895fd8f627fa9ac7ad6e9e;p=mono.git diff --git a/mono/mini/seq-points.c b/mono/mini/seq-points.c index 899544d1c02..f9c0b1f00ec 100644 --- a/mono/mini/seq-points.c +++ b/mono/mini/seq-points.c @@ -1,5 +1,6 @@ -/* - * seq-points.c: Sequence Points functions +/** + * \file + * Sequence Points functions * * Authors: * Marcos Henrich (marcos.henrich@xamarin.com) @@ -14,7 +15,6 @@ static void insert_pred_seq_point (MonoInst *last_seq_ins, MonoInst *ins, GSList **next) { - MonoBasicBlock *in_bb; GSList *l; int src_index = last_seq_ins->backend.size; int dst_index = ins->backend.size; @@ -64,7 +64,7 @@ recursively_make_pred_seq_points (MonoCompile *cfg, MonoBasicBlock *bb) for (int i=0; i < in_bb->num_pred_seq_points; i++) { if (!g_hash_table_lookup (seen, in_bb->pred_seq_points [i])) { g_array_append_val (predecessors, in_bb->pred_seq_points [i]); - g_hash_table_insert (seen, in_bb->pred_seq_points [i], &MONO_SEQ_SEEN_LOOP); + g_hash_table_insert (seen, in_bb->pred_seq_points [i], (gpointer)&MONO_SEQ_SEEN_LOOP); } } // predecessors = g_array_append_vals (predecessors, in_bb->pred_seq_points, in_bb->num_pred_seq_points); @@ -81,7 +81,7 @@ recursively_make_pred_seq_points (MonoCompile *cfg, MonoBasicBlock *bb) } } - g_free (predecessors); + g_array_free (predecessors, TRUE); } static void @@ -169,7 +169,7 @@ mono_save_seq_point_info (MonoCompile *cfg) if (l) { endfinally_seq_point = (MonoInst *)l->data; - for (bb2 = cfg->bb_entry; bb2; bb2 = bb2->next_bb) { + for (bb2 = bb->next_bb; bb2; bb2 = bb2->next_bb) { GSList *l = g_slist_last (bb2->seq_points); if (l) { @@ -224,20 +224,24 @@ mono_save_seq_point_info (MonoCompile *cfg) } } + g_free (seq_points); + if (has_debug_data) g_free (next); cfg->seq_point_info = mono_seq_point_info_new (array->len, TRUE, array->data, has_debug_data, &seq_info_size); - mono_jit_stats.allocated_seq_points_size += seq_info_size; + InterlockedAdd (&mono_jit_stats.allocated_seq_points_size, seq_info_size); g_byte_array_free (array, TRUE); // FIXME: dynamic methods if (!cfg->compile_aot) { mono_domain_lock (domain); - // FIXME: How can the lookup succeed ? + // FIXME: The lookup can fail if the method is JITted recursively though a type cctor if (!g_hash_table_lookup (domain_jit_info (domain)->seq_points, cfg->method_to_register)) g_hash_table_insert (domain_jit_info (domain)->seq_points, cfg->method_to_register, cfg->seq_point_info); + else + mono_seq_point_info_free (cfg->seq_point_info); mono_domain_unlock (domain); }