X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mono%2Fmini%2Fexceptions-x86.c;h=d3f09813c202f29cb035745f6decaa09f8302f80;hb=5b558abeeb255a3179d4ca6a85617e051c6abd38;hp=e6af5ee08241987d4ea8aebd6a914601258717eb;hpb=45890e8b46ac438d2b8ccc1bd0d74eea31870de1;p=mono.git diff --git a/mono/mini/exceptions-x86.c b/mono/mini/exceptions-x86.c index e6af5ee0824..d3f09813c20 100644 --- a/mono/mini/exceptions-x86.c +++ b/mono/mini/exceptions-x86.c @@ -308,6 +308,8 @@ mono_arch_get_restore_context (MonoTrampInfo **info, gboolean aot) /* jump to the saved IP */ x86_ret (code); + nacl_global_codeman_validate(&start, 128, &code); + if (info) *info = mono_tramp_info_create (g_strdup_printf ("restore_context"), start, code - start, ji, unwind_ops); else { @@ -335,11 +337,7 @@ mono_arch_get_call_filter (MonoTrampInfo **info, gboolean aot) guint8 *code; MonoJumpInfo *ji = NULL; GSList *unwind_ops = NULL; -#ifdef __native_client_codegen__ - guint kMaxCodeSize = 128; -#else - guint kMaxCodeSize = 64; -#endif /* __native_client_codegen__ */ + guint kMaxCodeSize = NACL_SIZE (64, 128); /* call_filter (MonoContext *ctx, unsigned long eip) */ start = code = mono_global_codeman_reserve (kMaxCodeSize); @@ -387,6 +385,8 @@ mono_arch_get_call_filter (MonoTrampInfo **info, gboolean aot) x86_leave (code); x86_ret (code); + nacl_global_codeman_validate(&start, kMaxCodeSize, &code); + if (info) *info = mono_tramp_info_create (g_strdup_printf ("call_filter"), start, code - start, ji, unwind_ops); else { @@ -515,11 +515,8 @@ get_throw_trampoline (const char *name, gboolean rethrow, gboolean llvm, gboolea int i, stack_size, stack_offset, arg_offsets [5], regs_offset; MonoJumpInfo *ji = NULL; GSList *unwind_ops = NULL; -#ifdef __native_client_codegen__ - guint kMaxCodeSize = 256; -#else - guint kMaxCodeSize = 128; -#endif + guint kMaxCodeSize = NACL_SIZE (128, 256); + start = code = mono_global_codeman_reserve (kMaxCodeSize); stack_size = 128; @@ -629,6 +626,8 @@ get_throw_trampoline (const char *name, gboolean rethrow, gboolean llvm, gboolea } x86_breakpoint (code); + nacl_global_codeman_validate(&start, kMaxCodeSize, &code); + g_assert ((code - start) < kMaxCodeSize); if (info)