- result = (MonoMethod *)g_new0 (MonoMethodPInvoke, 1);
- result->klass = klass;
- result->iflags = METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL;
- result->flags = METHOD_ATTRIBUTE_PUBLIC;
- result->signature = sig;
- result->name = mname;
-
- if (!strcmp (mname, ".ctor")) {
- /* we special-case this in the runtime. */
- return result;
- }
-
- if (!strcmp (mname, "Set")) {
- g_assert (sig->hasthis);
- g_assert (type->data.array->rank + 1 == sig->param_count);
- result->iflags |= METHOD_IMPL_ATTRIBUTE_RUNTIME;
- return result;
- }
-
- if (!strcmp (mname, "Get")) {
- g_assert (sig->hasthis);
- g_assert (type->data.array->rank == sig->param_count);
- result->iflags |= METHOD_IMPL_ATTRIBUTE_RUNTIME;
- return result;
- }
-
- if (!strcmp (mname, "Address")) {
- g_assert (sig->hasthis);
- g_assert (type->data.array->rank == sig->param_count);
- result->iflags |= METHOD_IMPL_ATTRIBUTE_RUNTIME;
+ /* we're an array and we created these methods already in klass in mono_class_init () */
+ result = search_in_array_class (klass, mname, sig);
+ if (result)