From bd9688e83bcb1309137886b378c07c66dc5501bc Mon Sep 17 00:00:00 2001 From: zoltan Date: Thu, 25 Feb 2010 00:40:21 +0000 Subject: [PATCH] 2010-02-25 Zoltan Varga * class.c (mono_class_init): Get rid of mono_setup_vtable_in_class_init. git-svn-id: svn+ssh://mono-cvs.ximian.com/source/trunk/mono@152421 e3ebcda4-bce8-0310-ba0a-eca2169e7518 --- mono/metadata/ChangeLog | 3 +++ mono/metadata/class.c | 48 ++++++++++++++---------------------------------- 2 files changed, 17 insertions(+), 34 deletions(-) diff --git a/mono/metadata/ChangeLog b/mono/metadata/ChangeLog index 73a296290..ab3376396 100644 --- a/mono/metadata/ChangeLog +++ b/mono/metadata/ChangeLog @@ -1,3 +1,6 @@ +2010-02-25 Zoltan Varga + + * class.c (mono_class_init): Get rid of mono_setup_vtable_in_class_init. Wed Feb 24 17:45:27 CET 2010 Paolo Molaro diff --git a/mono/metadata/class.c b/mono/metadata/class.c index d9e2c7912..1e34eeb12 100644 --- a/mono/metadata/class.c +++ b/mono/metadata/class.c @@ -46,13 +46,6 @@ MonoStats mono_stats; gboolean mono_print_vtable = FALSE; -/* - * Controls whenever mono_class_init () constructs a generic vtable. This is TRUE by - * default to avoid breaking embedding apps, but set to FALSE by the runtime executable - * startup code. - */ -gboolean mono_setup_vtable_in_class_init = TRUE; - /* Statistics */ guint32 inflated_classes, inflated_classes_size, inflated_methods_size; guint32 classes_size, class_ext_size; @@ -4431,41 +4424,28 @@ mono_class_init (MonoClass *class) } } - if (!mono_setup_vtable_in_class_init) { - /* - * This is an embedding API break, since the caller might assume that - * mono_class_init () constructs a generic vtable, so vtable construction errors - * are visible right after the mono_class_init (), and not after - * mono_class_vtable (). - */ - if (class->parent) { - /* This will compute class->parent->vtable_size for some classes */ - mono_class_init (class->parent); + if (class->parent) { + /* This will compute class->parent->vtable_size for some classes */ + mono_class_init (class->parent); + if (class->parent->exception_type) { + mono_class_set_failure (class, MONO_EXCEPTION_TYPE_LOAD, NULL); + goto leave; + } + if (mono_loader_get_last_error ()) + goto leave; + if (!class->parent->vtable_size) { + /* FIXME: Get rid of this somehow */ + mono_class_setup_vtable (class->parent); if (class->parent->exception_type) { mono_class_set_failure (class, MONO_EXCEPTION_TYPE_LOAD, NULL); goto leave; } if (mono_loader_get_last_error ()) goto leave; - if (!class->parent->vtable_size) { - /* FIXME: Get rid of this somehow */ - mono_class_setup_vtable (class->parent); - if (class->parent->exception_type) { - mono_class_set_failure (class, MONO_EXCEPTION_TYPE_LOAD, NULL); - goto leave; - } - if (mono_loader_get_last_error ()) - goto leave; - } - setup_interface_offsets (class, class->parent->vtable_size); - } else { - setup_interface_offsets (class, 0); } + setup_interface_offsets (class, class->parent->vtable_size); } else { - mono_class_setup_vtable (class); - - if (MONO_CLASS_IS_INTERFACE (class)) - setup_interface_offsets (class, 0); + setup_interface_offsets (class, 0); } goto leave; -- 2.11.4.GIT