addr = mono_create_jump_trampoline (mono_domain_get (), method, TRUE);
- return addr;
+ return mono_create_ftnptr (mono_domain_get (), addr);
}
/*
addr = mono_create_jump_trampoline (mono_domain_get (), method, FALSE);
- return addr;
+ return mono_create_ftnptr (mono_domain_get (), addr);
}
static void*
return 0;
}
+#if defined(MONO_ARCH_EMULATE_MUL_DIV) || defined(MONO_ARCH_EMULATE_DIV)
+
+static gint32
+mono_idiv (gint32 a, gint32 b)
+{
+ MONO_ARCH_SAVE_REGS;
+
+#ifdef MONO_ARCH_NEED_DIV_CHECK
+ if (!b)
+ mono_raise_exception (mono_get_exception_divide_by_zero ());
+ else if (b == -1 && a == (0x80000000))
+ mono_raise_exception (mono_get_exception_arithmetic ());
+#endif
+ return a / b;
+}
+
+static guint32
+mono_idiv_un (guint32 a, guint32 b)
+{
+ MONO_ARCH_SAVE_REGS;
+
+#ifdef MONO_ARCH_NEED_DIV_CHECK
+ if (!b)
+ mono_raise_exception (mono_get_exception_divide_by_zero ());
+#endif
+ return a / b;
+}
+
+static gint32
+mono_irem (gint32 a, gint32 b)
+{
+ MONO_ARCH_SAVE_REGS;
+
+#ifdef MONO_ARCH_NEED_DIV_CHECK
+ if (!b)
+ mono_raise_exception (mono_get_exception_divide_by_zero ());
+ else if (b == -1 && a == (0x80000000))
+ mono_raise_exception (mono_get_exception_arithmetic ());
+#endif
+
+ return a % b;
+}
+
+static guint32
+mono_irem_un (guint32 a, guint32 b)
+{
+ MONO_ARCH_SAVE_REGS;
+
+#ifdef MONO_ARCH_NEED_DIV_CHECK
+ if (!b)
+ mono_raise_exception (mono_get_exception_divide_by_zero ());
+#endif
+ return a % b;
+}
+
+#endif
+
+#ifdef MONO_ARCH_EMULATE_MUL_DIV
+
+static gint32
+mono_imul (gint32 a, gint32 b)
+{
+ MONO_ARCH_SAVE_REGS;
+
+ return a * b;
+}
+
+static gint32
+mono_imul_ovf (gint32 a, gint32 b)
+{
+ gint64 res;
+
+ MONO_ARCH_SAVE_REGS;
+
+ res = (gint64)a * (gint64)b;
+
+ if ((res > 0x7fffffffL) || (res < -2147483648))
+ mono_raise_exception (mono_get_exception_overflow ());
+
+ return res;
+}
+
+static gint32
+mono_imul_ovf_un (guint32 a, guint32 b)
+{
+ guint64 res;
+
+ MONO_ARCH_SAVE_REGS;
+
+ res = (guint64)a * (guint64)b;
+
+ if ((res >> 32))
+ mono_raise_exception (mono_get_exception_overflow ());
+
+ return res;
+}
+
+static double
+mono_fdiv (double a, double b)
+{
+ MONO_ARCH_SAVE_REGS;
+
+ return a / b;
+}
+#endif
+
static gint64
mono_lldiv (gint64 a, gint64 b)
{
}
esize *= ind;
- ea = (gpointer*)((char*)this->vector + esize);
+ ea = (gpointer*)(gpointer)((char*)this->vector + esize);
va_end(ap);
if (rank == pcount) {
/* Only lengths provided. */
- lower_bounds = NULL;
+ if (cm->klass->byval_arg.type == MONO_TYPE_ARRAY) {
+ lower_bounds = alloca (sizeof (guint32) * rank);
+ memset (lower_bounds, 0, sizeof (guint32) * rank);
+ } else {
+ lower_bounds = NULL;
+ }
} else {
g_assert (pcount == (rank * 2));
/* lower bounds are first. */
gpointer addr;
vmethod = mono_object_get_virtual_method (obj, method);
- inflated = mono_class_inflate_generic_method (vmethod, context, NULL);
+ inflated = mono_class_inflate_generic_method (vmethod, context);
inflated = mono_get_inflated_method (inflated);
addr = mono_compile_method (inflated);
return addr;
}
+
+static MonoString*
+helper_ldstr (MonoImage *image, guint32 idx)
+{
+ return mono_ldstr (mono_domain_get (), image, idx);
+}