Author: zoltan
Date: 2007-12-15 14:25:28 -0500 (Sat, 15 Dec 2007)
New Revision: 91359
Modified:
branches/vargaz/mini-linear-il/mono/mono/mini/ChangeLog
branches/vargaz/mini-linear-il/mono/mono/mini/method-to-ir.c
Log:
2007-12-15 Zoltan Varga <[EMAIL PROTECTED]>
* method-to-ir.c (mono_handle_global_vregs): Compress the varinfo
tables as
lots of variables might be made dead by this pass.
Modified: branches/vargaz/mini-linear-il/mono/mono/mini/ChangeLog
===================================================================
--- branches/vargaz/mini-linear-il/mono/mono/mini/ChangeLog 2007-12-15
19:19:09 UTC (rev 91358)
+++ branches/vargaz/mini-linear-il/mono/mono/mini/ChangeLog 2007-12-15
19:25:28 UTC (rev 91359)
@@ -1,5 +1,8 @@
2007-12-15 Zoltan Varga <[EMAIL PROTECTED]>
+ * method-to-ir.c (mono_handle_global_vregs): Compress the varinfo
tables as
+ lots of variables might be made dead by this pass.
+
* mini.c (mini_method_compile): Move the check for too-large methods
later.
* method-to-ir.c (mono_handle_global_vregs): Optimize this a little.
Modified: branches/vargaz/mini-linear-il/mono/mono/mini/method-to-ir.c
===================================================================
--- branches/vargaz/mini-linear-il/mono/mono/mini/method-to-ir.c
2007-12-15 19:19:09 UTC (rev 91358)
+++ branches/vargaz/mini-linear-il/mono/mono/mini/method-to-ir.c
2007-12-15 19:25:28 UTC (rev 91359)
@@ -4186,7 +4186,7 @@
}
/* allocate space to store the return value */
if (!MONO_TYPE_IS_VOID (fsig->ret)) {
- rvar = mono_compile_create_var (cfg, fsig->ret, OP_LOCAL);
+ rvar = mono_compile_create_var (cfg, fsig->ret, OP_LOCAL);
}
/* allocate local variables */
@@ -10090,7 +10090,7 @@
{
gint32 *vreg_to_bb;
MonoBasicBlock *bb;
- int i;
+ int i, pos;
vreg_to_bb = mono_mempool_alloc0 (cfg->mempool, sizeof (gint32*) *
cfg->next_vreg + 1);
@@ -10254,6 +10254,25 @@
break;
}
}
+
+ /*
+ * Compress the varinfo and vars tables so the liveness computation is
faster and
+ * takes up less space.
+ */
+ pos = 0;
+ for (i = 0; i < cfg->num_varinfo; ++i) {
+ MonoInst *var = cfg->varinfo [i];
+ if (!(var->flags & MONO_INST_IS_DEAD)) {
+ if (pos < i) {
+ cfg->varinfo [pos] = cfg->varinfo [i];
+ cfg->varinfo [pos]->inst_c0 = pos;
+ memcpy (&cfg->vars [pos], &cfg->vars [i],
sizeof (MonoMethodVar));
+ cfg->vars [pos].idx = pos;
+ }
+ pos ++;
+ }
+ }
+ cfg->num_varinfo = pos;
}
static void
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches