Author: zoltan
Date: 2005-03-24 06:39:06 -0500 (Thu, 24 Mar 2005)
New Revision: 42202

Modified:
   trunk/mono/mono/mini/ChangeLog
   trunk/mono/mono/mini/mini.c
Log:
2005-03-24  Zoltan Varga  <[EMAIL PROTECTED]>

        * mini.c (mono_precompile_assembly): Load and precompile referenced
        assemblies as well. Fixes #74015.


Modified: trunk/mono/mono/mini/ChangeLog
===================================================================
--- trunk/mono/mono/mini/ChangeLog      2005-03-24 11:26:02 UTC (rev 42201)
+++ trunk/mono/mono/mini/ChangeLog      2005-03-24 11:39:06 UTC (rev 42202)
@@ -1,3 +1,8 @@
+2005-03-24  Zoltan Varga  <[EMAIL PROTECTED]>
+
+       * mini.c (mono_precompile_assembly): Load and precompile referenced
+       assemblies as well. Fixes #74015.
+
 2005-03-23  Zoltan Varga  <[EMAIL PROTECTED]>
 
        * cpu-amd64.md (sin): Fix up maximum lengths of some opcodes.

Modified: trunk/mono/mono/mini/mini.c
===================================================================
--- trunk/mono/mono/mini/mini.c 2005-03-24 11:26:02 UTC (rev 42201)
+++ trunk/mono/mono/mini/mini.c 2005-03-24 11:39:06 UTC (rev 42202)
@@ -6110,6 +6110,11 @@
 
                                handle_loaded_temps (cfg, bblock, stack_start, 
sp);
 
+                               /*
+                               if (cmethod->flags & METHOD_ATTRIBUTE_ABSTRACT)
+                                       g_assert_not_reached ();
+                               */
+
                                NEW_METHODCONST (cfg, argconst, cmethod);
                                if (method->wrapper_type != 
MONO_WRAPPER_SYNCHRONIZED)
                                        temp = mono_emit_jit_icall (cfg, 
bblock, mono_ldftn, &argconst, ip);
@@ -10099,10 +10104,16 @@
 static void
 mono_precompile_assembly (MonoAssembly *ass, void *user_data)
 {
+       GHashTable *assemblies = (GHashTable*)user_data;
        MonoImage *image = mono_assembly_get_image (ass);
        MonoMethod *method, *invoke;
        int i, count = 0;
 
+       if (g_hash_table_lookup (assemblies, ass))
+               return;
+
+       g_hash_table_insert (assemblies, ass, ass);
+
        if (mini_verbose > 0)
                printf ("PRECOMPILE: %s.\n", mono_image_get_filename (image));
 
@@ -10127,9 +10138,20 @@
                        mono_compile_method (invoke);
                }
        }
+
+       /* Load and precompile referenced assemblies as well */
+       for (i = 0; i < mono_image_get_table_rows (image, 
MONO_TABLE_ASSEMBLYREF); ++i) {
+               mono_assembly_load_reference (image, i);
+               if (image->references [i])
+                       mono_precompile_assembly (image->references [i], 
assemblies);
+       }
 }
 
 void mono_precompile_assemblies ()
 {
-       mono_assembly_foreach ((GFunc)mono_precompile_assembly, NULL);
+       GHashTable *assemblies = g_hash_table_new (NULL, NULL);
+
+       mono_assembly_foreach ((GFunc)mono_precompile_assembly, assemblies);
+
+       g_hash_table_destroy (assemblies);
 }

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to