2008-08-22 Zoltan Varga <vargaz@gmail.com>
[mono.git] / mono / mini / dominators.c
index d5f334dc226cce0b4a580ad6b244ea95aef3343b..7f1b5826c6aec7fb6ef0ada6611cf2f42607dc63 100644 (file)
@@ -9,6 +9,8 @@
  */
 #include <string.h>
 #include <mono/metadata/debug-helpers.h>
+#include <mono/metadata/mempool.h>
+#include <mono/metadata/mempool-internals.h>
 
 #include "mini.h"
 
@@ -126,7 +128,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 */
@@ -148,6 +150,8 @@ compute_dominators (MonoCompile *cfg)
 #endif
 }
 
+#if 0
+
 static void
 check_dominance_frontier (MonoBasicBlock *x, MonoBasicBlock *t)
 {
@@ -176,6 +180,8 @@ check_dominance_frontier (MonoBasicBlock *x, MonoBasicBlock *t)
        }
 } 
 
+#endif
+
 /**
  * Compute dominance frontiers using the algorithm from the same paper.
  */
@@ -254,7 +260,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);
        }
 }
 
@@ -414,7 +420,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;
                }
        }