if (!info->image_table [i]) {
if (mono_aot_verbose > 0)
printf ("AOT module %s is out of date.\n", aot_name);
- g_free (info->methods);
+ mono_g_hash_table_destroy (info->methods);
g_free (info->image_table);
+#ifndef HAVE_BOEHM_GC
g_free (info);
+#endif
g_free (aot_name);
g_module_close (assembly->aot_module);
assembly->aot_module = NULL;
if (!method->token)
return NULL;
+ if (mono_profiler_get_events () & MONO_PROFILE_ENTER_LEAVE)
+ return NULL;
+
if ((method->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL) ||
(method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL) ||
(method->iflags & METHOD_IMPL_ATTRIBUTE_RUNTIME) ||
memcpy (code, minfo->info->code_start, minfo->info->code_size);
if (mono_aot_verbose > 1)
- printf ("REUSE METHOD: %s %p - %p.\n", mono_method_full_name (method, TRUE), code, (char*)code + code_len);
+ printf ("REUSE METHOD: %s %p - %p.\n", mono_method_full_name (method, TRUE), code, (char*)code + minfo->info->code_size);
/* Do this outside the lock to avoid deadlocks */
LeaveCriticalSection (&aot_mutex);
- mono_arch_patch_code (method, domain, code, minfo->patch_info);
+ mono_arch_patch_code (method, domain, code, minfo->patch_info, TRUE);
EnterCriticalSection (&aot_mutex);
/* Relocate jinfo */
gpointer *table;
int pages;
int i, err;
- guint32 last_offset;
+ guint32 last_offset, buf_len;
if (aot_module->opts & MONO_OPT_SHARED)
mp = mono_mempool_new ();
patch_info = ji;
}
+ info = (gpointer)((guint8*)info + 4);
+ buf_len = *(guint32*)info;
+ info = (gpointer)((guint8*)info + 4);
+ mono_debug_add_aot_method (domain, method, code, (guint8*)info, buf_len);
+
if (use_loaded_code) {
/* disable write protection */
#ifndef PLATFORM_WIN32
/* Do this outside the lock to avoid deadlocks */
LeaveCriticalSection (&aot_mutex);
- mono_arch_patch_code (method, domain, code, patch_info);
+ mono_arch_patch_code (method, domain, code, patch_info, TRUE);
EnterCriticalSection (&aot_mutex);
if (aot_module->opts & MONO_OPT_SHARED)
/* NULL terminated array */
fprintf (tmpfp, "\t.long 0\n");
+ {
+ guint8 *buf;
+ guint32 buf_len;
+
+ mono_debug_serialize_debug_info (cfg, &buf, &buf_len);
+
+ fprintf (tmpfp, "\t.long %d\n", buf_len);
+
+ for (i = 0; i < buf_len; ++i)
+ fprintf (tmpfp, ".byte %d\n", (unsigned int) buf [i]);
+
+ if (buf_len > 0)
+ g_free (buf);
+ }
+
/* fixme: save the rest of the required infos */
g_free (mname);
//printf ("START: %s\n", mono_method_full_name (method, TRUE));
//mono_compile_method (method);
- cfg = mini_method_compile (method, opts, mono_root_domain, 0);
+ cfg = mini_method_compile (method, opts, mono_root_domain, FALSE, 0);
g_assert (cfg);
if (cfg->disable_aot) {
system (com);
g_free (com);*/
- printf ("Compiled %d out of %d methods (%d%%)\n", ccount, mcount, (ccount*100)/mcount);
- printf ("%d methods contain absolute addresses (%d%%)\n", abscount, (abscount*100)/mcount);
- printf ("%d methods contain wrapper references (%d%%)\n", wrappercount, (wrappercount*100)/mcount);
- printf ("%d methods contain lmf pointers (%d%%)\n", lmfcount, (lmfcount*100)/mcount);
- printf ("%d methods have other problems (%d%%)\n", ocount, (ocount*100)/mcount);
+ printf ("Compiled %d out of %d methods (%d%%)\n", ccount, mcount, mcount ? (ccount*100)/mcount : 100);
+ printf ("%d methods contain absolute addresses (%d%%)\n", abscount, mcount ? (abscount*100)/mcount : 100);
+ printf ("%d methods contain wrapper references (%d%%)\n", wrappercount, mcount ? (wrappercount*100)/mcount : 100);
+ printf ("%d methods contain lmf pointers (%d%%)\n", lmfcount, mcount ? (lmfcount*100)/mcount : 100);
+ printf ("%d methods have other problems (%d%%)\n", ocount, mcount ? (ocount*100)/mcount : 100);
unlink (tmpfname);
return 0;