-
+/*
+ * (C) 2003 Ximian, Inc.
+ * (C) 2003-2011 Novell, Inc.
+ * Copyright 2011 Xamarin, Inc (http://www.xamarin.com)
+ */
#include <config.h>
#include <glib.h>
* Either IMPL_METHOD or AOT_ADDR will be set on return.
*/
static gpointer*
+#ifdef __GNUC__
+/*
+ * This works against problems when compiling with gcc 4.6 on arm. The 'then' part of
+ * this line gets executed, even when the condition is false:
+ * if (impl && mono_method_needs_static_rgctx_invoke (impl, FALSE))
+ * *need_rgctx_tramp = TRUE;
+ */
+__attribute__ ((noinline))
+#endif
mono_convert_imt_slot_to_vtable_slot (gpointer* slot, mgreg_t *regs, guint8 *code, MonoMethod *method, MonoMethod **impl_method, gboolean *need_rgctx_tramp, gboolean *variance_used, gpointer *aot_addr)
{
MonoObject *this_argument = mono_arch_get_this_arg_from_call (regs, code);
gboolean multicast, callvirt = FALSE;
gboolean need_rgctx_tramp = FALSE;
gboolean enable_caching = TRUE;
- gboolean disable_fast_path = FALSE;
MonoMethod *invoke = tramp_data [0];
guint8 *impl_this = tramp_data [1];
guint8 *impl_nothis = tramp_data [2];
method = mono_marshal_get_remoting_invoke (method);
}
else {
- MonoMethodSignature *iv_sig;
mono_error_init (&err);
sig = mono_method_signature_checked (method, &err);
if (!sig)
mono_error_raise_exception (&err);
-
- iv_sig = mono_method_signature_checked (invoke, &err);
- if (!iv_sig)
- mono_error_raise_exception (&err);
-
- if (sig->hasthis && method->klass->valuetype && !(iv_sig->param_count && iv_sig->params[0]->byref) && delegate->target)
+
+ if (sig->hasthis && method->klass->valuetype)
method = mono_marshal_get_unbox_wrapper (method);
}
} else {
if (!sig)
mono_error_raise_exception (&err);
- callvirt = !delegate->target && sig->hasthis && (method->flags & METHOD_ATTRIBUTE_VIRTUAL);
- disable_fast_path = !delegate->target && sig->hasthis;
-
+ callvirt = !delegate->target && sig->hasthis;
if (delegate->target &&
method->flags & METHOD_ATTRIBUTE_VIRTUAL &&
method->flags & METHOD_ATTRIBUTE_ABSTRACT &&
}
multicast = ((MonoMulticastDelegate*)delegate)->prev != NULL;
- if (!multicast && !callvirt && !disable_fast_path) {
+ if (!multicast && !callvirt) {
if (method && (method->flags & METHOD_ATTRIBUTE_STATIC) && mono_method_signature (method)->param_count == mono_method_signature (invoke)->param_count + 1)
/* Closed static delegate */
code = impl_this;
{
MonoContext ctx;
MonoException *exc;
- MonoJitTlsData *jit_tls = TlsGetValue (mono_jit_tls_id);
+ MonoJitTlsData *jit_tls = mono_native_tls_get_value (mono_jit_tls_id);
gpointer resume_ip = jit_tls->handler_block_return_address;
memcpy (&ctx, &jit_tls->handler_block_context, sizeof (MonoContext));
if (!restore_context)
restore_context = mono_get_restore_context ();
- mono_handle_exception (&ctx, exc, NULL, FALSE);
+ mono_handle_exception (&ctx, exc);
restore_context (&ctx);
}
MonoDomain *domain = mono_domain_get ();
guint8 *buf, *start;
- buf = start = mono_domain_code_reserve (domain, 2 * sizeof (gpointer));
+ buf = start = mono_domain_alloc0 (domain, 2 * sizeof (gpointer));
*(gpointer*)(gpointer)buf = image;
buf += sizeof (gpointer);
mono_create_monitor_enter_trampoline (void)
{
static gpointer code;
- MonoTrampInfo *info;
if (mono_aot_only) {
if (!code)
mono_trampolines_lock ();
if (!code) {
+ MonoTrampInfo *info;
+
code = mono_arch_create_monitor_enter_trampoline (&info, FALSE);
if (info) {
mono_save_trampoline_xdebug_info (info);
mono_create_monitor_exit_trampoline (void)
{
static gpointer code;
- MonoTrampInfo *info;
if (mono_aot_only) {
if (!code)
mono_trampolines_lock ();
if (!code) {
+ MonoTrampInfo *info;
+
code = mono_arch_create_monitor_exit_trampoline (&info, FALSE);
if (info) {
mono_save_trampoline_xdebug_info (info);