فهرست منبع

2007-01-21 Zoltan Varga <[email protected]>

	* inssel.brg: Fix a warning.

	* mini.h (MonoBasicBlock): Make bb->dominated a GSList.

	* abcremoval.c ssa.c ssapre.c: Update after this change.
	
	* dominators.c (compute_dominators): Allocate bb->dominated from the cfg mempool.

	* dominators.c (df_set): Use mono_bitset_union_fast.	

svn path=/trunk/mono/; revision=71413
Zoltan Varga 19 سال پیش
والد
کامیت
5d68dbabbc
7فایلهای تغییر یافته به همراه40 افزوده شده و 9 حذف شده
  1. 11 0
      mono/mini/ChangeLog
  2. 2 2
      mono/mini/abcremoval.c
  3. 15 3
      mono/mini/dominators.c
  4. 8 0
      mono/mini/inssel.brg
  5. 1 1
      mono/mini/mini.h
  6. 1 1
      mono/mini/ssa.c
  7. 2 2
      mono/mini/ssapre.c

+ 11 - 0
mono/mini/ChangeLog

@@ -1,3 +1,14 @@
+2007-01-21  Zoltan Varga  <[email protected]>
+
+	* inssel.brg: Fix a warning.
+
+	* mini.h (MonoBasicBlock): Make bb->dominated a GSList.
+
+	* abcremoval.c ssa.c ssapre.c: Update after this change.
+	
+	* dominators.c (compute_dominators): Allocate bb->dominated from the cfg mempool.
+
+	* dominators.c (df_set): Use mono_bitset_union_fast.	
 
 Sat Jan 20 16:59:01 CET 2007 Paolo Molaro <[email protected]>
 

+ 2 - 2
mono/mini/abcremoval.c

@@ -1237,7 +1237,7 @@ process_block (MonoBasicBlock *bb, MonoVariableRelationsEvaluationArea *area) {
 	int inst_index;
 	MonoInst *current_inst;
 	MonoAdditionalVariableRelationsForBB additional_relations;
-	GList *dominated_bb;
+	GSList *dominated_bb;
 	
 	if (TRACE_ABC_REMOVAL) {
 		printf ("Processing block %d [dfn %d]...\n", bb->block_num, bb->dfn);
@@ -1277,7 +1277,7 @@ process_block (MonoBasicBlock *bb, MonoVariableRelationsEvaluationArea *area) {
 		printf ("Processing block %d [dfn %d] done.\n", bb->block_num, bb->dfn);
 	}
 	
-	for (dominated_bb = g_list_first (bb->dominated); dominated_bb != NULL; dominated_bb = g_list_next (dominated_bb)) {
+	for (dominated_bb = bb->dominated; dominated_bb != NULL; dominated_bb = dominated_bb->next) {
 		process_block ((MonoBasicBlock*) (dominated_bb->data), area);
 	}
 	

+ 15 - 3
mono/mini/dominators.c

@@ -20,6 +20,19 @@
  */
 #define HAS_DFN(bb, entry) ((bb)->dfn || ((bb) == entry))
 
+static inline GSList*
+g_slist_prepend_mempool (MonoMemPool *mp, GSList   *list,
+						 gpointer  data)
+{
+  GSList *new_list;
+
+  new_list = mono_mempool_alloc (mp, sizeof (GSList));
+  new_list->data = data;
+  new_list->next = list;
+
+  return new_list;
+}
+
 /*
  * Compute dominators and immediate dominators using the algorithm in the
  * paper "A Simple, Fast Dominance Algorithm" by Keith D. Cooper, 
@@ -126,7 +139,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 */
@@ -254,7 +267,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 +427,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;
 		}
 	}

+ 8 - 0
mono/mini/inssel.brg

@@ -1592,8 +1592,12 @@ stmt: CEE_MKREFANY (OP_GROUP (reg, OP_I8CONST), reg) {
 
 %%
 
+#ifdef MONO_ARCH_NEED_GOT_VAR
+
 static void mini_emit_aotconst (MonoCompile *cfg, int dreg, MonoJumpInfoType patch_type, gpointer cons);
 
+#endif
+
 /* 
  * Emit code which checks whenever the interface id of @klass is smaller than
  * than the value given by max_iid_reg.
@@ -1909,6 +1913,8 @@ mini_emit_memset (MonoCompile *s, int destreg, int offset, int size, int val, in
 	}
 }
 
+#ifdef MONO_ARCH_NEED_GOT_VAR
+
 /* This is similar to NEW_AOTCONST in mini.c, but generates linear IL */
 static void
 mini_emit_aotconst (MonoCompile *cfg, int dreg, MonoJumpInfoType patch_type, gpointer cons)
@@ -1944,6 +1950,8 @@ mini_emit_aotconst (MonoCompile *cfg, int dreg, MonoJumpInfoType patch_type, gpo
 	mono_bblock_add_inst (cfg->cbb, dest);
 }
 
+#endif
+
 static int
 ldind_to_load_membase (int opcode)
 {

+ 1 - 1
mono/mini/mini.h

@@ -204,7 +204,7 @@ struct MonoBasicBlock {
 	MonoBitSet *dominators;
 	MonoBitSet *dfrontier;
 	MonoBasicBlock *idom;
-	GList *dominated;
+	GSList *dominated;
 	/* fast dominator algorithm */
 	MonoBasicBlock *df_parent, *ancestor, *child, *label;
 	MonoEdge *bucket;

+ 1 - 1
mono/mini/ssa.c

@@ -195,7 +195,7 @@ mono_ssa_rename_vars (MonoCompile *cfg, int max_vars, MonoBasicBlock *bb, MonoIn
 {
 	MonoInst *inst, *new_var;
 	int i, j, idx;
-	GList *tmp;
+	GSList *tmp;
 	MonoInst **new_stack;
 
 #ifdef DEBUG_SSA

+ 2 - 2
mono/mini/ssapre.c

@@ -804,7 +804,7 @@ static void
 process_bb (MonoSsapreWorkArea *area, MonoBasicBlock *bb, int *dt_dfn, int *upper_descendants, int current_depth) {
 	MonoSsapreBBInfo *bb_info;
 	int descendants;
-	GList *dominated_bb;
+	GSList *dominated_bb;
 	MonoInst* current_inst;
 	MonoInst* previous_inst;
 	MonoSsapreFatherExpression** dummy_father_in_tree;
@@ -872,7 +872,7 @@ process_bb (MonoSsapreWorkArea *area, MonoBasicBlock *bb, int *dt_dfn, int *uppe
 		area->dt_depth = current_depth;
 	}
 	descendants = 0;
-	for (dominated_bb = g_list_first (bb->dominated); dominated_bb != NULL; dominated_bb = g_list_next (dominated_bb)) {
+	for (dominated_bb = bb->dominated; dominated_bb != NULL; dominated_bb = dominated_bb->next) {
 		process_bb (area, (MonoBasicBlock*) (dominated_bb->data), dt_dfn, &descendants, current_depth + 1);
 	}
 	bb_info->dt_descendants = descendants;