[aot] Only emit instances when using full aot.
authorZoltan Varga <vargaz@gmail.com>
Tue, 29 Nov 2016 05:22:42 +0000 (00:22 -0500)
committerZoltan Varga <vargaz@gmail.com>
Tue, 29 Nov 2016 05:22:42 +0000 (00:22 -0500)
mono/mini/aot-compiler.c

index 7401d231944d42fb2b6344a8bad7c61fa28559dd..3c626c2de1c5d646567312e91394ea6735afa21e 100644 (file)
@@ -7645,7 +7645,7 @@ compile_method (MonoAotCompile *acfg, MonoMethod *method)
         * encountered.
         */
        depth = GPOINTER_TO_UINT (g_hash_table_lookup (acfg->method_depth, method));
-       if (!acfg->aot_opts.no_instances && depth < 32) {
+       if (!acfg->aot_opts.no_instances && depth < 32 && mono_aot_mode_is_full (&acfg->aot_opts)) {
                for (patch_info = cfg->patch_info; patch_info; patch_info = patch_info->next) {
                        switch (patch_info->type) {
                        case MONO_PATCH_INFO_RGCTX_FETCH:
@@ -7664,7 +7664,7 @@ compile_method (MonoAotCompile *acfg, MonoMethod *method)
 
                                if (!m)
                                        break;
-                               if (m->is_inflated) {
+                               if (m->is_inflated && mono_aot_mode_is_full (&acfg->aot_opts)) {
                                        if (!(mono_class_generic_sharing_enabled (m->klass) &&
                                                  mono_method_is_generic_sharable_full (m, FALSE, FALSE, FALSE)) &&
                                                (!method_has_type_vars (m) || mono_method_is_generic_sharable_full (m, TRUE, TRUE, FALSE))) {
@@ -9869,7 +9869,8 @@ collect_methods (MonoAotCompile *acfg)
                }
        }
 
-       add_generic_instances (acfg);
+       if (mono_aot_mode_is_full (&acfg->aot_opts))
+               add_generic_instances (acfg);
 
        if (mono_aot_mode_is_full (&acfg->aot_opts))
                add_wrappers (acfg);