2009-06-09 Zoltan Varga <vargaz@gmail.com>
authorZoltan Varga <vargaz@gmail.com>
Tue, 9 Jun 2009 21:10:35 +0000 (21:10 -0000)
committerZoltan Varga <vargaz@gmail.com>
Tue, 9 Jun 2009 21:10:35 +0000 (21:10 -0000)
* aot-runtime.c (mono_aot_plt_resolve): Avoid creating trampolines in
the full-aot case if possible, since the trampoline will be called right
away.

* aot-compiler.c (mono_compile_assembly): Decrease the number of full aot
trampolines to 1024 after the change above.

svn path=/trunk/mono/; revision=135785

mono/mini/ChangeLog
mono/mini/aot-compiler.c
mono/mini/aot-runtime.c

index c6d2260dd07882057228d67480f24c754fa57eef..487eb6fb09bc88df1b56a8306c334529419c1567 100644 (file)
@@ -1,5 +1,12 @@
 2009-06-09  Zoltan Varga  <vargaz@gmail.com>
 
+       * aot-runtime.c (mono_aot_plt_resolve): Avoid creating trampolines in
+       the full-aot case if possible, since the trampoline will be called right 
+       away.
+
+       * aot-compiler.c (mono_compile_assembly): Decrease the number of full aot
+       trampolines to 1024 after the change above.
+
        * aot-compiler.c (arch_emit_specific_trampoline): Rework the arm
        trampoline to save 8 bytes per trampoline.
 
index 10ad0fefb5774aa480334c1ba971396451fad3ab..93950ce7d3e6a0d79f444af9b3bcc6cd07da127f 100644 (file)
@@ -4642,7 +4642,7 @@ mono_compile_assembly (MonoAssembly *ass, guint32 opts, const char *aot_options)
 
        memset (&acfg->aot_opts, 0, sizeof (acfg->aot_opts));
        acfg->aot_opts.write_symbols = TRUE;
-       acfg->aot_opts.ntrampolines = 10240;
+       acfg->aot_opts.ntrampolines = 1024;
 
        mono_aot_parse_options (aot_options, &acfg->aot_opts);
 
index d8bd61db15aacce87ffc2c13ee9adac6edede095..442bf70b528e27a1c279168e5c94a50a38d86f47 100644 (file)
@@ -2364,7 +2364,18 @@ mono_aot_plt_resolve (gpointer aot_module, guint32 plt_info_offset, guint8 *code
        // FIXME: Error handling (how ?)
        g_assert (res);
 
-       target = mono_resolve_patch_target (NULL, mono_domain_get (), NULL, &ji, TRUE);
+       /* 
+        * Avoid calling resolve_patch_target in the full-aot case if possible, since
+        * it would create a trampoline, and we don't need that.
+        * We could do this only if the method does not need the special handling
+        * in mono_magic_trampoline ().
+        */
+       if (mono_aot_only && ji.type == MONO_PATCH_INFO_METHOD && !ji.data.method->is_generic && !mono_method_check_context_used (ji.data.method) && !(ji.data.method->iflags & METHOD_IMPL_ATTRIBUTE_SYNCHRONIZED) &&
+               !mono_method_needs_static_rgctx_invoke (ji.data.method, FALSE)) {
+               target = mono_jit_compile_method (ji.data.method);
+       } else {
+               target = mono_resolve_patch_target (NULL, mono_domain_get (), NULL, &ji, TRUE);
+       }
 
        mono_mempool_destroy (mp);