Branch: refs/heads/master
Home: https://github.com/mono/mono
Compare: https://github.com/mono/mono/compare/53c777d22bb0...63eb94e451a5
Commit: 11b2e3e60fccecb3877a42f8e6f19e472edc0519
Author: Rodrigo Kumpera <[email protected]> (kumpera)
Date: 2013-11-01 19:05:55 GMT
URL: https://github.com/mono/mono/commit/11b2e3e60fccecb3877a42f8e6f19e472edc0519
[jit]Extract emit_init_local and use it with the ldloca optimization to handle any kind of types.
Changed paths:
M mono/mini/method-to-ir.c
Modified: mono/mini/method-to-ir.c
===================================================================
@@ -5610,6 +5610,20 @@
}
}
+static void
+emit_init_local (MonoCompile *cfg, int local, MonoType *type)
+{
+ MonoInst *var = cfg->locals [local];
+ if (COMPILE_SOFT_FLOAT (cfg)) {
+ MonoInst *store;
+ int reg = alloc_dreg (cfg, var->type);
+ emit_init_rvar (cfg, reg, type);
+ EMIT_NEW_LOCSTORE (cfg, store, local, cfg->cbb->last_ins);
+ } else {
+ emit_init_rvar (cfg, var->dreg, type);
+ }
+}
+
static int
inline_method (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSignature *fsig, MonoInst **sp,
guchar *ip, guint real_offset, GList *dont_inline, gboolean inline_always)
@@ -6239,6 +6253,7 @@ gboolean check_linkdemand (MonoCompile *cfg, MonoMethod *caller, MonoMethod *cal
{
int local, token;
MonoClass *klass;
+ MonoType *type;
if (size == 1) {
local = ip [1];
@@ -6249,22 +6264,13 @@ gboolean check_linkdemand (MonoCompile *cfg, MonoMethod *caller, MonoMethod *cal
}
if (ip + 6 < end && (ip [0] == CEE_PREFIX1) && (ip [1] == CEE_INITOBJ) && ip_in_bb (cfg, cfg->cbb, ip + 1)) {
- gboolean skip = FALSE;
-
/* From the INITOBJ case */
token = read32 (ip + 2);
klass = mini_get_class (cfg->current_method, token, cfg->generic_context);
CHECK_TYPELOAD (klass);
- if (mini_type_is_reference (cfg, &klass->byval_arg)) {
- MONO_EMIT_NEW_PCONST (cfg, cfg->locals [local]->dreg, NULL);
- } else if (MONO_TYPE_ISSTRUCT (&klass->byval_arg)) {
- MONO_EMIT_NEW_VZERO (cfg, cfg->locals [local]->dreg, klass);
- } else {
- skip = TRUE;
- }
-
- if (!skip)
- return ip + 6;
+ type = &klass->byval_arg;
+ emit_init_local (cfg, local, type);
+ return ip + 6;
}
load_error:
return NULL;
@@ -11784,15 +11790,7 @@ gboolean check_linkdemand (MonoCompile *cfg, MonoMethod *caller, MonoMethod *cal
cfg->cbb = init_localsbb;
cfg->ip = NULL;
for (i = 0; i < header->num_locals; ++i) {
- MonoInst *var = cfg->locals [i];
- if (COMPILE_SOFT_FLOAT (cfg)) {
- MonoInst *store;
- int reg = alloc_dreg (cfg, var->type);
- emit_init_rvar (cfg, reg, header->locals [i]);
- EMIT_NEW_LOCSTORE (cfg, store, i, cfg->cbb->last_ins);
- } else {
- emit_init_rvar (cfg, var->dreg, header->locals [i]);
- }
+ emit_init_local (cfg, i, header->locals [i]);
}
}
Commit: 63eb94e451a59491034516f2ec9f27d586b34d86
Author: Rodrigo Kumpera <[email protected]> (kumpera)
Date: 2013-11-01 19:27:12 GMT
URL: https://github.com/mono/mono/commit/63eb94e451a59491034516f2ec9f27d586b34d86
[jit] Avoid linking the try block with the EH block as this produces spurious BBs during inlining.
The inliner could not handle optimally when we inline code inside the try block as it would be linked
with the catch block.
Since the source block would have more than one exit, the inliner would conservatively not link them together,
which hinders further local optimizations.
Changed paths:
M mono/mini/method-to-ir.c
Modified: mono/mini/method-to-ir.c
===================================================================
@@ -6681,7 +6681,11 @@ gboolean check_linkdemand (MonoCompile *cfg, MonoMethod *caller, MonoMethod *cal
tblock->real_offset = clause->handler_offset;
tblock->flags |= BB_EXCEPTION_HANDLER;
- link_bblock (cfg, try_bb, tblock);
+ /*
+ Linking the try block with the EH block hinders inlining as we won't be able to merge the bblocks from inlining
+ and produce an artificial hole for no good reason.
+ */
+ // link_bblock (cfg, try_bb, tblock);
if (*(ip + clause->handler_offset) == CEE_POP)
tblock->flags |= BB_EXCEPTION_DEAD_OBJ;
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.