Skip to content

Commit

Permalink
Revert "Use gsharedvt for some generic instances in full-aot mode to …
Browse files Browse the repository at this point in the history
…avoid code blowup."

This reverts commit 9f36e10.

Revert this as it breaks some mt tests.
  • Loading branch information
vargaz committed May 29, 2013
1 parent 9f36e10 commit dcfebb9
Showing 1 changed file with 1 addition and 22 deletions.
23 changes: 1 addition & 22 deletions mono/mini/aot-compiler.c
Original file line number Diff line number Diff line change
Expand Up @@ -3614,19 +3614,6 @@ has_type_vars (MonoClass *klass)
return FALSE;
}

static gboolean
is_vt_inst (MonoGenericInst *inst)
{
int i;

for (i = 0; i < inst->type_argc; ++i) {
MonoType *t = inst->type_argv [i];
if (t->type == MONO_TYPE_VALUETYPE)
return TRUE;
}
return FALSE;
}

static gboolean
method_has_type_vars (MonoMethod *method)
{
Expand Down Expand Up @@ -3697,7 +3684,6 @@ add_generic_class_with_depth (MonoAotCompile *acfg, MonoClass *klass, int depth,
MonoMethod *method;
MonoClassField *field;
gpointer iter;
gboolean use_gsharedvt = FALSE;

if (!acfg->ginst_hash)
acfg->ginst_hash = g_hash_table_new (NULL, NULL);
Expand Down Expand Up @@ -3730,16 +3716,9 @@ add_generic_class_with_depth (MonoAotCompile *acfg, MonoClass *klass, int depth,

g_hash_table_insert (acfg->ginst_hash, klass, klass);

/*
* Use gsharedvt for generic collections with vtype arguments to avoid code blowup.
* Enable this only for some classes since gsharedvt might not support all methods.
*/
if ((acfg->opts & MONO_OPT_GSHAREDVT) && klass->image == mono_defaults.corlib && klass->generic_class && klass->generic_class->context.class_inst && is_vt_inst (klass->generic_class->context.class_inst) && (!strcmp (klass->name, "Dictionary`2") || !strcmp (klass->name, "List`1")))
use_gsharedvt = TRUE;

iter = NULL;
while ((method = mono_class_get_methods (klass, &iter))) {
if (mono_method_is_generic_sharable_full (method, FALSE, FALSE, use_gsharedvt))
if (mono_method_is_generic_sharable_full (method, FALSE, FALSE, FALSE))
/* Already added */
continue;

Expand Down

0 comments on commit dcfebb9

Please sign in to comment.