[runtime] Format MethodAccessException method names to use the same formating as...
[mono.git] / mono / mini / jit-icalls.c
index 765d3096a1cd2707f02b2d45e89bb1b2a75f8943..255ab56533a5fed56be61fd7ae1476aad2d3726c 100644 (file)
@@ -1,5 +1,6 @@
-/*
- * jit-icalls.c: internal calls used by the JIT
+/**
+ * \file
+ * internal calls used by the JIT
  *
  * Author:
  *   Dietmar Maurer (dietmar@ximian.com)
@@ -887,11 +888,16 @@ mono_class_static_field_address (MonoDomain *domain, MonoClassField *field)
 
        //printf ("SFLDA1 %p\n", (char*)vtable->data + field->offset);
 
-       if (domain->special_static_fields && (addr = g_hash_table_lookup (domain->special_static_fields, field)))
+       if (field->offset == -1) {
+               /* Special static */
+               g_assert (domain->special_static_fields);
+               mono_domain_lock (domain);
+               addr = g_hash_table_lookup (domain->special_static_fields, field);
+               mono_domain_unlock (domain);
                addr = mono_get_special_static_data (GPOINTER_TO_UINT (addr));
-       else
+       } else {
                addr = (char*)mono_vtable_get_static_field_data (vtable) + field->offset;
-       
+       }
        return addr;
 }
 
@@ -1083,16 +1089,6 @@ mono_lconv_to_r8_un (guint64 a)
 }
 #endif
 
-#if defined(__native_client_codegen__) || defined(__native_client__)
-/* When we cross-compile to Native Client we can't directly embed calls */
-/* to the math library on the host. This will use the fmod on the target*/
-double
-mono_fmod(double a, double b)
-{
-       return fmod(a, b);
-}
-#endif
-
 gpointer
 mono_helper_compile_generic_method (MonoObject *obj, MonoMethod *method, gpointer *this_arg)
 {
@@ -1452,11 +1448,15 @@ mono_generic_class_init (MonoVTable *vtable)
 }
 
 void
-ves_icall_mono_delegate_ctor (MonoObject *this_obj, MonoObject *target, gpointer addr)
+ves_icall_mono_delegate_ctor (MonoObject *this_obj_raw, MonoObject *target_raw, gpointer addr)
 {
+       HANDLE_FUNCTION_ENTER ();
        MonoError error;
+       MONO_HANDLE_DCL (MonoObject, this_obj);
+       MONO_HANDLE_DCL (MonoObject, target);
        mono_delegate_ctor (this_obj, target, addr, &error);
        mono_error_set_pending_exception (&error);
+       HANDLE_FUNCTION_RETURN ();
 }
 
 gpointer
@@ -1909,14 +1909,14 @@ mono_interruption_checkpoint_from_trampoline (void)
 }
 
 void
-mono_throw_method_access (MonoMethod *callee, MonoMethod *caller)
+mono_throw_method_access (MonoMethod *caller, MonoMethod *callee)
 {
-       char *callee_name = mono_method_full_name (callee, 1);
-       char *caller_name = mono_method_full_name (caller, 1);
+       char *caller_name = mono_method_get_reflection_name (caller);
+       char *callee_name = mono_method_get_reflection_name (callee);
        MonoError error;
 
        error_init (&error);
-       mono_error_set_generic_error (&error, "System", "MethodAccessException", "Method `%s' is inaccessible from method `%s'\n", callee_name, caller_name);
+       mono_error_set_generic_error (&error, "System", "MethodAccessException", "Method `%s' is inaccessible from method `%s'", callee_name, caller_name);
        mono_error_set_pending_exception (&error);
        g_free (callee_name);
        g_free (caller_name);