X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mono%2Fmini%2Fdominators.c;h=5024e066f19386af89c0d5fe9faab85412209027;hb=92f60fbffa1187be7dedf6a9286b5c35b2082815;hp=d5f334dc226cce0b4a580ad6b244ea95aef3343b;hpb=a3ea7ceb4d4f5e2cb8ea421313e8939640fb898c;p=mono.git diff --git a/mono/mini/dominators.c b/mono/mini/dominators.c index d5f334dc226..5024e066f19 100644 --- a/mono/mini/dominators.c +++ b/mono/mini/dominators.c @@ -9,9 +9,13 @@ */ #include #include +#include +#include #include "mini.h" +#ifndef DISABLE_JIT + //#define DEBUG_DOMINATORS /* @@ -126,7 +130,7 @@ compute_dominators (MonoCompile *cfg) bb->idom = doms [bb->dfn]; if (bb->idom) - bb->idom->dominated = g_list_prepend (bb->idom->dominated, bb); + bb->idom->dominated = g_slist_prepend_mempool (cfg->mempool, bb->idom->dominated, bb); } /* The entry bb */ @@ -139,7 +143,7 @@ compute_dominators (MonoCompile *cfg) #ifdef DEBUG_DOMINATORS printf ("DTREE %s %d\n", mono_method_full_name (cfg->method, TRUE), - mono_method_get_header (cfg->method)->num_clauses); + cfg->header->num_clauses); for (i = 0; i < cfg->num_bblocks; ++i) { MonoBasicBlock *bb = cfg->bblocks [i]; printf ("BB%d(dfn=%d) (IDOM=BB%d): ", bb->block_num, bb->dfn, bb->idom ? bb->idom->block_num : -1); @@ -148,6 +152,8 @@ compute_dominators (MonoCompile *cfg) #endif } +#if 0 + static void check_dominance_frontier (MonoBasicBlock *x, MonoBasicBlock *t) { @@ -176,6 +182,8 @@ check_dominance_frontier (MonoBasicBlock *x, MonoBasicBlock *t) } } +#endif + /** * Compute dominance frontiers using the algorithm from the same paper. */ @@ -254,7 +262,7 @@ df_set (MonoCompile *m, MonoBitSet* dest, MonoBitSet *set) int i; mono_bitset_foreach_bit (set, i, m->num_bblocks) { - mono_bitset_union (dest, m->bblocks [i]->dfrontier); + mono_bitset_union_fast (dest, m->bblocks [i]->dfrontier); } } @@ -335,7 +343,7 @@ mono_compute_natural_loops (MonoCompile *cfg) if ((cb->dfn && mono_bitset_test_fast (in_loop_blocks, cb->dfn)) || (!cb->dfn && g_list_find (h->loop_blocks, cb))) continue; - h->loop_blocks = g_list_prepend (h->loop_blocks, cb); + h->loop_blocks = g_list_prepend_mempool (cfg->mempool, h->loop_blocks, cb); cb->nesting++; if (cb->dfn) mono_bitset_set_fast (in_loop_blocks, cb->dfn); @@ -351,7 +359,7 @@ mono_compute_natural_loops (MonoCompile *cfg) /* add the header if not already there */ if (!((h->dfn && mono_bitset_test_fast (in_loop_blocks, h->dfn)) || (!h->dfn && g_list_find (h->loop_blocks, h)))) { - h->loop_blocks = g_list_prepend (h->loop_blocks, h); + h->loop_blocks = g_list_prepend_mempool (cfg->mempool, h->loop_blocks, h); h->nesting++; } } @@ -414,7 +422,6 @@ clear_idominators (MonoCompile *cfg) for (i = 0; i < cfg->num_bblocks; ++i) { if (cfg->bblocks[i]->dominated) { - g_list_free (cfg->bblocks[i]->dominated); cfg->bblocks[i]->dominated = NULL; } } @@ -429,10 +436,7 @@ clear_loops (MonoCompile *cfg) for (i = 0; i < cfg->num_bblocks; ++i) { cfg->bblocks[i]->nesting = 0; - if (cfg->bblocks[i]->loop_blocks) { - g_list_free (cfg->bblocks[i]->loop_blocks); - cfg->bblocks[i]->loop_blocks = NULL; - } + cfg->bblocks[i]->loop_blocks = NULL; } cfg->comp_done &= ~MONO_COMP_LOOPS; @@ -446,3 +450,12 @@ mono_free_loop_info (MonoCompile *cfg) if (cfg->comp_done & MONO_COMP_LOOPS) clear_loops (cfg); } + +#else /* DISABLE_JIT */ + +void +mono_free_loop_info (MonoCompile *cfg) +{ +} + +#endif /* DISABLE_JIT */