X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mono%2Fmini%2Fjit-icalls.c;h=6accfcbe0fde6b25e80483a106b8e57e4bde9fb5;hb=102197b11d6ce990d2bdc2325ed944a05e780e40;hp=94940d36cdd718111236b2b5f3efb2266cb86ed8;hpb=1f97a75d45e78dbf3d5c9fda1f2f4c9212f7936f;p=mono.git diff --git a/mono/mini/jit-icalls.c b/mono/mini/jit-icalls.c index 94940d36cdd..6accfcbe0fd 100644 --- a/mono/mini/jit-icalls.c +++ b/mono/mini/jit-icalls.c @@ -7,9 +7,12 @@ * * (C) 2002 Ximian, Inc. */ - +#include #include #include +#ifdef HAVE_ALLOCA_H +#include +#endif #include "jit-icalls.h" @@ -49,8 +52,7 @@ ldvirtfn_internal (MonoObject *obj, MonoMethod *method, gboolean gshared) res = mono_class_inflate_generic_method (res, &context); } - if (mono_method_needs_static_rgctx_invoke (res, FALSE)) - res = mono_marshal_get_static_rgctx_invoke (res); + /* An rgctx wrapper is added by the trampolines no need to do it here */ return mono_ldftn (res); } @@ -285,7 +287,7 @@ mono_irem_un (guint32 a, guint32 b) #endif -#ifdef MONO_ARCH_EMULATE_MUL_DIV +#if defined(MONO_ARCH_EMULATE_MUL_DIV) || defined(MONO_ARCH_EMULATE_MUL_OVF) gint32 mono_imul (gint32 a, gint32 b) @@ -304,7 +306,7 @@ mono_imul_ovf (gint32 a, gint32 b) res = (gint64)a * (gint64)b; - if ((res > 0x7fffffffL) || (res < -2147483648)) + if ((res > 0x7fffffffL) || (res < -2147483648LL)) mono_raise_exception (mono_get_exception_overflow ()); return res; @@ -597,6 +599,17 @@ mono_fclt_un (double a, double b) return isunordered (a, b) || a < b; } +gboolean +mono_isfinite (double a) +{ +#ifdef HAVE_ISFINITE + return isfinite (a); +#else + g_assert_not_reached (); + return TRUE; +#endif +} + double mono_fload_r4 (float *ptr) { @@ -730,7 +743,7 @@ mono_class_static_field_address (MonoDomain *domain, MonoClassField *field) mono_class_init (field->parent); - vtable = mono_class_vtable (domain, field->parent); + vtable = mono_class_vtable_full (domain, field->parent, TRUE); if (!vtable->initialized) mono_runtime_class_init (vtable); @@ -886,7 +899,7 @@ mono_lconv_to_r8_un (guint64 a) gpointer mono_helper_compile_generic_method (MonoObject *obj, MonoMethod *method, gpointer *this_arg) { - MonoMethod *vmethod, *inflated; + MonoMethod *vmethod; gpointer addr; MonoGenericContext *context = mono_method_get_context (method); @@ -895,20 +908,14 @@ mono_helper_compile_generic_method (MonoObject *obj, MonoMethod *method, gpointe if (obj == NULL) mono_raise_exception (mono_get_exception_null_reference ()); vmethod = mono_object_get_virtual_method (obj, method); - - /* 'vmethod' is partially inflated. All the blanks corresponding to the type parameters of the - declaring class have been inflated. We still need to fully inflate the method parameters. - - FIXME: This code depends on the declaring class being fully inflated, since we inflate it twice with - the same context. - */ g_assert (!vmethod->klass->generic_container); g_assert (!vmethod->klass->generic_class || !vmethod->klass->generic_class->context.class_inst->is_open); g_assert (!context->method_inst || !context->method_inst->is_open); - inflated = mono_class_inflate_generic_method (vmethod, context); - if (mono_method_needs_static_rgctx_invoke (inflated, FALSE)) - inflated = mono_marshal_get_static_rgctx_invoke (inflated); - addr = mono_compile_method (inflated); + + addr = mono_compile_method (vmethod); + + if (mono_method_needs_static_rgctx_invoke (vmethod, FALSE)) + addr = mono_create_static_rgctx_trampoline (vmethod, addr); /* Since this is a virtual call, have to unbox vtypes */ if (obj->vtable->klass->valuetype)