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.
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);
// 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);