From 329f824e61650428696414dbabbd891ca3481bab Mon Sep 17 00:00:00 2001 From: Zoltan Varga Date: Sat, 5 Dec 2009 05:56:48 +0000 Subject: [PATCH] 2009-12-05 Zoltan Varga * aot-compiler.c (emit_trampoline): Emit the trampoline info into the global blob. * aot-runtime.c (load_function): Update after the change above. * mini.h: Bump AOT file format version. svn path=/trunk/mono/; revision=147736 --- mono/mini/ChangeLog | 9 ++++++++- mono/mini/aot-compiler.c | 8 +++++--- mono/mini/aot-runtime.c | 2 ++ mono/mini/mini.h | 2 +- 4 files changed, 16 insertions(+), 5 deletions(-) diff --git a/mono/mini/ChangeLog b/mono/mini/ChangeLog index 031a73ee6fe..18a454e2ea1 100644 --- a/mono/mini/ChangeLog +++ b/mono/mini/ChangeLog @@ -1,5 +1,12 @@ 2009-12-05 Zoltan Varga + * aot-compiler.c (emit_trampoline): Emit the trampoline info into the global + blob. + + * aot-runtime.c (load_function): Update after the change above. + + * mini.h: Bump AOT file format version. + * method-to-ir.c (mono_method_to_ir): Disallow the delegate optimization if the delegate class is dynamic. @@ -9,7 +16,7 @@ 2009-12-04 Geoff Norton - * debugger-agent.c: When doing a func-eval invoke on a suspended runtime, + * debugger-agent.c: When doing a func-eval invoke on a suspended runtime, we need to track the original suspend count so the thread properly wakes up in resume_thread. diff --git a/mono/mini/aot-compiler.c b/mono/mini/aot-compiler.c index 4807295a07b..ae0af34cfab 100644 --- a/mono/mini/aot-compiler.c +++ b/mono/mini/aot-compiler.c @@ -3397,7 +3397,7 @@ emit_trampoline (MonoAotCompile *acfg, const char *name, guint8 *code, { char start_symbol [256]; char symbol [256]; - guint32 buf_size; + guint32 buf_size, info_offset; MonoJumpInfo *patch_info; guint8 *buf, *p; GPtrArray *patches; @@ -3440,11 +3440,13 @@ emit_trampoline (MonoAotCompile *acfg, const char *name, guint8 *code, sprintf (symbol, "%s_p", name); + info_offset = add_to_blob (acfg, buf, p - buf); + emit_section_change (acfg, ".text", 0); emit_global (acfg, symbol, FALSE); emit_label (acfg, symbol); - - emit_bytes (acfg, buf, p - buf); + + emit_int32 (acfg, info_offset); /* Emit debug info */ if (unwind_ops) { diff --git a/mono/mini/aot-runtime.c b/mono/mini/aot-runtime.c index 61472ba18f4..2650bd09094 100644 --- a/mono/mini/aot-runtime.c +++ b/mono/mini/aot-runtime.c @@ -2932,6 +2932,8 @@ load_function (MonoAotModule *amodule, const char *name) /* Nothing to patch */ return code; + p = amodule->blob + *(guint32*)p; + /* Similar to mono_aot_load_method () */ n_patches = decode_value (p, &p); diff --git a/mono/mini/mini.h b/mono/mini/mini.h index 797ac00c0be..3612c7655e4 100644 --- a/mono/mini/mini.h +++ b/mono/mini/mini.h @@ -89,7 +89,7 @@ typedef gint64 mgreg_t; #endif /* Version number of the AOT file format */ -#define MONO_AOT_FILE_VERSION "64" +#define MONO_AOT_FILE_VERSION "65" //TODO: This is x86/amd64 specific. #define mono_simd_shuffle_mask(a,b,c,d) ((a) | ((b) << 2) | ((c) << 4) | ((d) << 6)) -- 2.25.1