From 96f90f145b4e0db1cff436915181e3d1efc70db6 Mon Sep 17 00:00:00 2001 From: Massimiliano Mantione Date: Tue, 13 Jun 2006 21:00:22 +0000 Subject: [PATCH] * mini.c: Made so that inline is locally disabled if it would trigger a .cctor, because too many apps depend on this behavior (which seems to be also the one of the MS CLR). svn path=/trunk/mono/; revision=61683 --- mono/mini/ChangeLog | 5 +++++ mono/mini/mini.c | 16 ++++++++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/mono/mini/ChangeLog b/mono/mini/ChangeLog index e1cf0027a2f..8e176351e40 100644 --- a/mono/mini/ChangeLog +++ b/mono/mini/ChangeLog @@ -1,3 +1,8 @@ +2006-06-13 Massimiliano Mantione + * mini.c: Made so that inline is locally disabled if it would + trigger a .cctor, because too many apps depend on this behavior + (which seems to be also the one of the MS CLR). + 2006-06-13 Zoltan Varga * mini-amd64.c (mono_emit_stack_alloc): Fix initialization of localloc'ed memory. diff --git a/mono/mini/mini.c b/mono/mini/mini.c index 03bf678ec32..a887fda2d3a 100644 --- a/mono/mini/mini.c +++ b/mono/mini/mini.c @@ -2955,8 +2955,14 @@ mono_method_check_inlining (MonoCompile *cfg, MonoMethod *method) if (!(cfg->opt & MONO_OPT_SHARED)) { vtable = mono_class_vtable (cfg->domain, method->klass); if (method->klass->flags & TYPE_ATTRIBUTE_BEFORE_FIELD_INIT) { - if (cfg->run_cctors) + if (cfg->run_cctors) { + /* This makes so that inline cannot trigger */ + /* .cctors: too many apps depend on them */ + /* running with a specific order... */ + if (! vtable->initialized) + return FALSE; mono_runtime_class_init (vtable); + } } else if (!vtable->initialized && mono_class_needs_cctor_run (method->klass, NULL)) return FALSE; @@ -5918,8 +5924,14 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b g_print ("class %s.%s needs init call for %s\n", klass->name_space, klass->name, field->name); class_inits = g_slist_prepend (class_inits, vtable); } else { - if (cfg->run_cctors) + if (cfg->run_cctors) { + /* This makes so that inline cannot trigger */ + /* .cctors: too many apps depend on them */ + /* running with a specific order... */ + if (! vtable->initialized) + INLINE_FAILURE; mono_runtime_class_init (vtable); + } } addr = (char*)vtable->data + field->offset; -- 2.25.1