mono_create_handler_block_trampoline (void)
{
static gpointer code;
- if (code) {
+
+ if (code)
+ return code;
+
+ if (mono_aot_only) {
+ gpointer tmp = mono_aot_get_trampoline ("handler_block_trampoline");
+ g_assert (tmp);
mono_memory_barrier ();
+ code = tmp;
return code;
}
- g_assert (!mono_aot_only);
-
mono_trampolines_lock ();
-
if (!code) {
MonoTrampInfo *info;
gpointer tmp;
mono_error_init (error);
if (mono_aot_only) {
+ if (mono_llvm_only && method->iflags & METHOD_IMPL_ATTRIBUTE_SYNCHRONIZED)
+ method = mono_marshal_get_synchronized_wrapper (method);
+
/* Avoid creating trampolines if possible */
gpointer code = mono_jit_find_compiled_method (domain, method);