-/*
- * icall.c:
+/**
+ * \file
*
* Authors:
* Dietmar Maurer (dietmar@ximian.com)
mono_gc_bzero_atomic (mono_array_addr_with_size_fast (arr, sz, idx), length * sz);
}
-ICALL_EXPORT MonoArray*
-ves_icall_System_Array_Clone (MonoArray *arr)
-{
- MonoError error;
- MonoArray *result = mono_array_clone_checked (arr, &error);
- mono_error_set_pending_exception (&error);
- return result;
-}
ICALL_EXPORT gboolean
ves_icall_System_Array_FastCopy (MonoArray *source, int source_idx, MonoArray* dest, int dest_idx, int length)
ves_icall_Remoting_RealProxy_InternalGetProxyType (MonoTransparentProxy *tp)
{
MonoError error;
+ g_assert (tp != NULL && mono_object_class (tp) == mono_defaults.transparent_proxy_class);
+ g_assert (tp->remote_class != NULL && tp->remote_class->proxy_class != NULL);
MonoReflectionType *ret = mono_type_get_object_checked (mono_object_domain (tp), &tp->remote_class->proxy_class->byval_arg, &error);
mono_error_set_pending_exception (&error);
#endif
ICALL_EXPORT MonoArray *
-ves_icall_System_Environment_GetCoomandLineArgs (void)
+ves_icall_System_Environment_GetCommandLineArgs (void)
{
MonoError error;
MonoArray *result = mono_runtime_get_main_args_checked (&error);
MonoMethod *base = mono_method_get_base_method (method, definition, error);
return_val_if_nok (error, MONO_HANDLE_CAST (MonoReflectionMethod, NULL_HANDLE));
- if (base == method)
- return m;
- else
- return mono_method_get_object_handle (mono_domain_get (), base, NULL, error);
+ if (base == method) {
+ /* we want to short-circuit and return 'm' here. But we should
+ return the same method object that
+ mono_method_get_object_handle, below would return. Since
+ that call takes NULL for the reftype argument, it will take
+ base->klass as the reflected type for the MonoMethod. So we
+ need to check that m also has base->klass as the reflected
+ type. */
+ MonoReflectionTypeHandle orig_reftype = MONO_HANDLE_NEW_GET (MonoReflectionType, m, reftype);
+ MonoClass *orig_klass = mono_class_from_mono_type (MONO_HANDLE_GETVAL (orig_reftype, type));
+ if (base->klass == orig_klass)
+ return m;
+ }
+ return mono_method_get_object_handle (mono_domain_get (), base, NULL, error);
}
ICALL_EXPORT MonoStringHandle
/**
* mono_add_internal_call:
- * @name: method specification to surface to the managed world
- * @method: pointer to a C method to invoke when the method is called
+ * \param name method specification to surface to the managed world
+ * \param method pointer to a C method to invoke when the method is called
*
- * This method surfaces the C function pointed by @method as a method
+ * This method surfaces the C function pointed by \p method as a method
* that has been surfaced in managed code with the method specified in
- * @name as an internal call.
+ * \p name as an internal call.
*
* Internal calls are surfaced to all app domains loaded and they are
* accessibly by a type with the specified name.
*
* For example, the following are all valid declarations:
*
- * "MyApp.Services.ScriptService:Accelerate"
- * "MyApp.Services.ScriptService:Slowdown(int,bool)"
+ * \c MyApp.Services.ScriptService:Accelerate
+ *
+ * \c MyApp.Services.ScriptService:Slowdown(int,bool)
*
* You use method parameters in cases where there might be more than
* one surface method to managed code. That way you can register different
* internal calls for different method overloads.
*
* The internal calls are invoked with no marshalling. This means that .NET
- * types like System.String are exposed as `MonoString *` parameters. This is
+ * types like \c System.String are exposed as \c MonoString* parameters. This is
* different than the way that strings are surfaced in P/Invoke.
*
* For more information on how the parameters are marshalled, see the
/**
* mono_lookup_internal_call_full:
- * @method: the method to look up
- * @uses_handles: out argument if method needs handles around managed objects.
- *
- * Returns a pointer to the icall code for the given method. If
- * uses_handles is not NULL, it will be set to TRUE if the method
+ * \param method the method to look up
+ * \param uses_handles out argument if method needs handles around managed objects.
+ * \returns a pointer to the icall code for the given method. If
+ * \p uses_handles is not NULL, it will be set to TRUE if the method
* needs managed objects wrapped using the infrastructure in handle.h
*
* If the method is not found, warns and returns NULL.
#endif
}
+/**
+ * mono_lookup_internal_call:
+ */
gpointer
mono_lookup_internal_call (MonoMethod *method)
{