bug fixes, code cleanup
[mono.git] / mono / metadata / loader.c
1 /*
2  * loader.c: Image Loader 
3  *
4  * Authors:
5  *   Paolo Molaro (lupus@ximian.com)
6  *   Miguel de Icaza (miguel@ximian.com)
7  *
8  * (C) 2001 Ximian, Inc.
9  *
10  * This file is used by the interpreter and the JIT engine to locate
11  * assemblies.  Used to load AssemblyRef and later to resolve various
12  * kinds of `Refs'.
13  *
14  * TODO:
15  *   This should keep track of the assembly versions that we are loading.
16  *
17  */
18 #include <config.h>
19 #include <glib.h>
20 #include <gmodule.h>
21 #include <stdio.h>
22 #include <string.h>
23 #include <mono/metadata/metadata.h>
24 #include <mono/metadata/image.h>
25 #include <mono/metadata/assembly.h>
26 #include <mono/metadata/tokentype.h>
27 #include <mono/metadata/cil-coff.h>
28 #include <mono/metadata/tabledefs.h>
29 #include <mono/metadata/loader.h>
30 #include <mono/metadata/class.h>
31
32 static gboolean dummy_icall = TRUE;
33
34 MonoDefaults mono_defaults;
35
36 #ifdef __CYGWIN__
37 #define mono_map_dll(name) (name)
38 #else
39 static char *dll_map[] = {
40         "libc", "libc.so.6",
41         "libm", "libm.so.6",
42         "cygwin1.dll", "libc.so.6", 
43         NULL, NULL
44 };
45
46 static const char *
47 mono_map_dll (const char *name)
48 {
49         int i = 0;
50
51         while (dll_map [i]) {
52                 if (!strcmp (dll_map [i], name))
53                         return  dll_map [i + 1];
54                 i += 2;
55         }
56
57         return name;
58 }
59 #endif
60
61 void
62 mono_init (void)
63 {
64         static gboolean initialized = FALSE;
65         MonoAssembly *ass;
66         enum MonoImageOpenStatus status = MONO_IMAGE_OK;
67
68         if (initialized)
69                 return;
70
71         /* find the corlib */
72         ass = mono_assembly_open (CORLIB_NAME, NULL, &status);
73         g_assert (status == MONO_IMAGE_OK);
74         g_assert (ass != NULL);
75         mono_defaults.corlib = ass->image;
76
77         mono_defaults.object_class = mono_class_from_name (
78                 mono_defaults.corlib, "System", "Object");
79         g_assert (mono_defaults.object_class != 0);
80
81         mono_defaults.void_class = mono_class_from_name (
82                 mono_defaults.corlib, "System", "Void");
83         g_assert (mono_defaults.void_class != 0);
84
85         mono_defaults.boolean_class = mono_class_from_name (
86                 mono_defaults.corlib, "System", "Boolean");
87         g_assert (mono_defaults.boolean_class != 0);
88
89         mono_defaults.byte_class = mono_class_from_name (
90                 mono_defaults.corlib, "System", "Byte");
91         g_assert (mono_defaults.byte_class != 0);
92
93         mono_defaults.sbyte_class = mono_class_from_name (
94                 mono_defaults.corlib, "System", "SByte");
95         g_assert (mono_defaults.sbyte_class != 0);
96
97         mono_defaults.int16_class = mono_class_from_name (
98                 mono_defaults.corlib, "System", "Int16");
99         g_assert (mono_defaults.int16_class != 0);
100
101         mono_defaults.uint16_class = mono_class_from_name (
102                 mono_defaults.corlib, "System", "UInt16");
103         g_assert (mono_defaults.uint16_class != 0);
104
105         mono_defaults.int32_class = mono_class_from_name (
106                 mono_defaults.corlib, "System", "Int32");
107         g_assert (mono_defaults.int32_class != 0);
108
109         mono_defaults.uint32_class = mono_class_from_name (
110                 mono_defaults.corlib, "System", "UInt32");
111         g_assert (mono_defaults.uint32_class != 0);
112
113         mono_defaults.uint_class = mono_class_from_name (
114                 mono_defaults.corlib, "System", "UIntPtr");
115         g_assert (mono_defaults.uint_class != 0);
116
117         mono_defaults.int_class = mono_class_from_name (
118                 mono_defaults.corlib, "System", "IntPtr");
119         g_assert (mono_defaults.int_class != 0);
120
121         mono_defaults.int64_class = mono_class_from_name (
122                 mono_defaults.corlib, "System", "Int64");
123         g_assert (mono_defaults.int64_class != 0);
124
125         mono_defaults.uint64_class = mono_class_from_name (
126                 mono_defaults.corlib, "System", "UInt64");
127         g_assert (mono_defaults.uint64_class != 0);
128
129         mono_defaults.single_class = mono_class_from_name (
130                 mono_defaults.corlib, "System", "Single");
131         g_assert (mono_defaults.single_class != 0);
132
133         mono_defaults.double_class = mono_class_from_name (
134                 mono_defaults.corlib, "System", "Double");
135         g_assert (mono_defaults.double_class != 0);
136
137         mono_defaults.char_class = mono_class_from_name (
138                 mono_defaults.corlib, "System", "Char");
139         g_assert (mono_defaults.char_class != 0);
140
141         mono_defaults.string_class = mono_class_from_name (
142                 mono_defaults.corlib, "System", "String");
143         g_assert (mono_defaults.string_class != 0);
144
145         mono_defaults.enum_class = mono_class_from_name (
146                 mono_defaults.corlib, "System", "Enum");
147         g_assert (mono_defaults.enum_class != 0);
148
149         mono_defaults.array_class = mono_class_from_name (
150                 mono_defaults.corlib, "System", "Array");
151         g_assert (mono_defaults.array_class != 0);
152
153         mono_defaults.delegate_class = mono_class_from_name (
154                 mono_defaults.corlib, "System", "Delegate");
155         g_assert (mono_defaults.delegate_class != 0);
156
157         mono_defaults.typehandle_class = mono_class_from_name (
158                 mono_defaults.corlib, "System", "RuntimeTypeHandle");
159         g_assert (mono_defaults.typehandle_class != 0);
160
161         mono_defaults.methodhandle_class = mono_class_from_name (
162                 mono_defaults.corlib, "System", "RuntimeMethodHandle");
163         g_assert (mono_defaults.methodhandle_class != 0);
164
165         mono_defaults.fieldhandle_class = mono_class_from_name (
166                 mono_defaults.corlib, "System", "RuntimeFieldHandle");
167         g_assert (mono_defaults.fieldhandle_class != 0);
168
169         mono_defaults.monotype_class = mono_class_from_name (
170                 mono_defaults.corlib, "System", "MonoType");
171         g_assert (mono_defaults.monotype_class != 0);
172
173         mono_defaults.exception_class = mono_class_from_name (
174                 mono_defaults.corlib, "System", "Exception");
175         g_assert (mono_defaults.exception_class != 0);
176 }
177
178 static GHashTable *icall_hash = NULL;
179
180 void
181 mono_add_internal_call (const char *name, gpointer method)
182 {
183         if (!icall_hash) {
184                 dummy_icall = FALSE;
185                 icall_hash = g_hash_table_new (g_str_hash , g_str_equal);
186         }
187
188         g_hash_table_insert (icall_hash, g_strdup (name), method);
189 }
190
191 static void
192 ves_icall_dummy ()
193 {
194         g_warning ("the mono runtime is not initialized");
195         g_assert_not_reached ();
196 }
197
198 gpointer
199 mono_lookup_internal_call (const char *name)
200 {
201         gpointer res;
202
203         if (dummy_icall)
204                 return ves_icall_dummy;
205
206         if (!icall_hash) {
207                 g_warning ("icall_hash not initialized");
208                 g_assert_not_reached ();
209         }
210
211         if (!(res = g_hash_table_lookup (icall_hash, name))) {
212                 g_warning ("cant resolve internal call to \"%s\"", name);
213                 return NULL;
214         }
215
216         return res;
217 }
218
219 MonoClassField*
220 mono_field_from_memberref (MonoImage *image, guint32 token, MonoClass **retklass)
221 {
222         MonoImage *mimage;
223         MonoClass *klass;
224         MonoTableInfo *tables = image->tables;
225         guint32 cols[6];
226         guint32 nindex, class, i;
227         const char *fname, *name, *nspace;
228         const char *ptr;
229         guint32 index = mono_metadata_token_index (token);
230
231         mono_metadata_decode_row (&tables [MONO_TABLE_MEMBERREF], index-1, cols, MONO_MEMBERREF_SIZE);
232         nindex = cols [MONO_MEMBERREF_CLASS] >> MEMBERREF_PARENT_BITS;
233         class = cols [MONO_MEMBERREF_CLASS] & MEMBERREF_PARENT_MASK;
234
235         fname = mono_metadata_string_heap (image, cols [MONO_MEMBERREF_NAME]);
236         
237         ptr = mono_metadata_blob_heap (image, cols [MONO_MEMBERREF_SIGNATURE]);
238         mono_metadata_decode_blob_size (ptr, &ptr);
239         /* we may want to check the signature here... */
240
241         switch (class) {
242         case MEMBERREF_PARENT_TYPEREF: {
243                 guint32 scopeindex, scopetable;
244
245                 mono_metadata_decode_row (&tables [MONO_TABLE_TYPEREF], nindex-1, cols, MONO_TYPEREF_SIZE);
246                 scopeindex = cols [MONO_TYPEREF_SCOPE] >> RESOLTION_SCOPE_BITS;
247                 scopetable = cols [MONO_TYPEREF_SCOPE] & RESOLTION_SCOPE_MASK;
248                 /*g_print ("typeref: 0x%x 0x%x %s.%s\n", scopetable, scopeindex,
249                         mono_metadata_string_heap (m, cols [MONO_TYPEREF_NAMESPACE]),
250                         mono_metadata_string_heap (m, cols [MONO_TYPEREF_NAME]));*/
251                 switch (scopetable) {
252                 case RESOLTION_SCOPE_ASSEMBLYREF:
253                         /*
254                          * To find the field we have the following info:
255                          * *) name and namespace of the class from the TYPEREF table
256                          * *) name and signature of the field from the MEMBERREF table
257                          */
258                         nspace = mono_metadata_string_heap (image, cols [MONO_TYPEREF_NAMESPACE]);
259                         name = mono_metadata_string_heap (image, cols [MONO_TYPEREF_NAME]);
260
261                         /* this will triggered by references to mscorlib */
262                         if (image->references [scopeindex-1] == NULL)
263                                 g_error ("Reference to mscorlib? Probably need to implement %s.%s::%s in corlib", nspace, name, fname);
264
265                         mimage = image->references [scopeindex-1]->image;
266
267                         klass = mono_class_from_name (mimage, nspace, name);
268                         mono_class_metadata_init (klass);
269
270                         /* mostly dumb search for now */
271                         for (i = 0; i < klass->field.count; ++i) {
272                                 MonoClassField *f = &klass->fields [i];
273                                 if (!strcmp (fname, f->name)) {
274                                         if (retklass)
275                                                 *retklass = klass;
276                                         return f;
277                                 }
278                         }
279                         g_warning ("Missing field %s.%s::%s", nspace, name, fname);
280                         return NULL;
281                 default:
282                         return NULL;
283                 }
284                 break;
285         }
286         default:
287                 return NULL;
288         }
289 }
290
291 static MonoMethod *
292 method_from_memberref (MonoImage *image, guint32 index)
293 {
294         MonoImage *mimage;
295         MonoClass *klass;
296         MonoTableInfo *tables = image->tables;
297         guint32 cols[6];
298         guint32 nindex, class, i;
299         const char *mname, *name, *nspace;
300         MonoMethodSignature *sig;
301         const char *ptr;
302
303         mono_metadata_decode_row (&tables [MONO_TABLE_MEMBERREF], index-1, cols, 3);
304         nindex = cols [MONO_MEMBERREF_CLASS] >> MEMBERREF_PARENT_BITS;
305         class = cols [MONO_MEMBERREF_CLASS] & MEMBERREF_PARENT_MASK;
306         /*g_print ("methodref: 0x%x 0x%x %s\n", class, nindex,
307                 mono_metadata_string_heap (m, cols [MONO_MEMBERREF_NAME]));*/
308
309         mname = mono_metadata_string_heap (image, cols [MONO_MEMBERREF_NAME]);
310         
311         ptr = mono_metadata_blob_heap (image, cols [MONO_MEMBERREF_SIGNATURE]);
312         mono_metadata_decode_blob_size (ptr, &ptr);
313         sig = mono_metadata_parse_method_signature (image, 0, ptr, NULL);
314
315         switch (class) {
316         case MEMBERREF_PARENT_TYPEREF: {
317                 guint32 scopeindex, scopetable;
318
319                 mono_metadata_decode_row (&tables [MONO_TABLE_TYPEREF], nindex-1, cols, MONO_TYPEREF_SIZE);
320                 scopeindex = cols [MONO_TYPEREF_SCOPE] >> RESOLTION_SCOPE_BITS;
321                 scopetable = cols [MONO_TYPEREF_SCOPE] & RESOLTION_SCOPE_MASK;
322                 /*g_print ("typeref: 0x%x 0x%x %s.%s\n", scopetable, scopeindex,
323                         mono_metadata_string_heap (m, cols [MONO_TYPEREF_NAMESPACE]),
324                         mono_metadata_string_heap (m, cols [MONO_TYPEREF_NAME]));*/
325                 switch (scopetable) {
326                 case RESOLTION_SCOPE_ASSEMBLYREF:
327                         /*
328                          * To find the method we have the following info:
329                          * *) name and namespace of the class from the TYPEREF table
330                          * *) name and signature of the method from the MEMBERREF table
331                          */
332                         nspace = mono_metadata_string_heap (image, cols [MONO_TYPEREF_NAMESPACE]);
333                         name = mono_metadata_string_heap (image, cols [MONO_TYPEREF_NAME]);
334
335                         /* this will triggered by references to mscorlib */
336                         if (image->references [scopeindex-1] == NULL)
337                                 g_error ("Reference to mscorlib? Probably need to implement %s.%s::%s in corlib", nspace, name, mname);
338
339                         mimage = image->references [scopeindex-1]->image;
340
341                         klass = mono_class_from_name (mimage, nspace, name);
342                         mono_class_metadata_init (klass);
343
344                         /* 
345                          * FIXME: this is a workaround for the different signatures
346                          * in delegates constructors you get in user code (native int)
347                          * and in mscorlib (native unsigned int)
348                          */
349                         if (klass->parent && klass->parent->parent == mono_defaults.delegate_class) {
350                                 for (i = 0; i < klass->method.count; ++i) {
351                                         MonoMethod *m = klass->methods [i];
352                                         if (!strcmp (mname, m->name)) {
353                                                 if (!strcmp (mname, ".ctor")) {
354                                                         /* we assume signature is correct */
355                                                         mono_metadata_free_method_signature (sig);
356                                                         return m;
357                                                 }
358                                                 if (mono_metadata_signature_equal (sig, m->signature)) {
359                                                         mono_metadata_free_method_signature (sig);
360                                                         return m;
361                                                 }
362                                         }
363                                 }
364                         }
365                         /* mostly dumb search for now */
366                         for (i = 0; i < klass->method.count; ++i) {
367                                 MonoMethod *m = klass->methods [i];
368                                 if (!strcmp (mname, m->name)) {
369                                         if (mono_metadata_signature_equal (sig, m->signature)) {
370                                                 mono_metadata_free_method_signature (sig);
371                                                 return m;
372                                         }
373                                 }
374                         }
375                         g_warning ("Missing method %s.%s::%s", nspace, name, mname);
376                         mono_metadata_free_method_signature (sig);
377                         return NULL;
378                 default:
379                         mono_metadata_free_method_signature (sig);
380                         return NULL;
381                 }
382                 break;
383         }
384         case MEMBERREF_PARENT_TYPESPEC: {
385                 guint32 bcols [MONO_TYPESPEC_SIZE];
386                 guint32 len;
387                 MonoType *type;
388                 MonoMethod *result;
389
390                 mono_metadata_decode_row (&tables [MONO_TABLE_TYPESPEC], nindex - 1, 
391                                           bcols, MONO_TYPESPEC_SIZE);
392                 ptr = mono_metadata_blob_heap (image, bcols [MONO_TYPESPEC_SIGNATURE]);
393                 len = mono_metadata_decode_value (ptr, &ptr);   
394                 type = mono_metadata_parse_type (image, MONO_PARSE_TYPE, 0, ptr, &ptr);
395
396                 if (type->type != MONO_TYPE_ARRAY)
397                         g_assert_not_reached ();                
398
399                 result = (MonoMethod *)g_new0 (MonoMethodPInvoke, 1);
400                 result->klass = mono_class_get (image, MONO_TOKEN_TYPE_SPEC | nindex);
401                 result->iflags = METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL;
402                 result->signature = sig;
403                 result->name = mname;
404
405                 if (!strcmp (mname, ".ctor")) {
406                         /* we special-case this in the runtime. */
407                         result->addr = NULL;
408                         return result;
409                 }
410                 
411                 if (!strcmp (mname, "Set")) {
412                         g_assert (sig->hasthis);
413                         g_assert (type->data.array->rank + 1 == sig->param_count);
414
415                         result->addr = mono_lookup_internal_call ("__array_Set");
416                         return result;
417                 }
418
419                 if (!strcmp (mname, "Get")) {
420                         g_assert (sig->hasthis);
421                         g_assert (type->data.array->rank == sig->param_count);
422
423                         result->addr = mono_lookup_internal_call ("__array_Get");
424                         return result;
425                 }
426
427                 g_assert_not_reached ();
428                 break;
429         }
430         default:
431                 g_assert_not_reached ();
432         }
433
434         return NULL;
435 }
436
437 static void
438 fill_pinvoke_info (MonoImage *image, MonoMethodPInvoke *piinfo, int index)
439 {
440         MonoMethod *mh = &piinfo->method;
441         MonoTableInfo *tables = image->tables;
442         MonoTableInfo *im = &tables [MONO_TABLE_IMPLMAP];
443         MonoTableInfo *mr = &tables [MONO_TABLE_MODULEREF];
444         guint32 im_cols [4];
445         guint32 mr_cols [1];
446         const char *import = NULL;
447         const char *scope = NULL;
448         char *full_name;
449         GModule *gmodule;
450         int i;
451
452         for (i = 0; i < im->rows; i++) {
453                         
454                 mono_metadata_decode_row (im, i, im_cols, 4);
455
456                 if ((im_cols[1] >> 1) == index + 1) {
457
458                         import = mono_metadata_string_heap (image, im_cols [2]);
459
460                         mono_metadata_decode_row (mr, im_cols [3] - 1, mr_cols,
461                                                   1);
462                         
463                         scope = mono_metadata_string_heap (image, mr_cols [0]);
464                 }
465         }
466
467         piinfo->piflags = im_cols [0];
468
469         g_assert (import && scope);
470
471         scope = mono_map_dll (scope);
472         full_name = g_module_build_path (NULL, scope);
473         gmodule = g_module_open (full_name, G_MODULE_BIND_LAZY);
474
475         mh->addr = NULL;
476         if (!gmodule) {
477                 if (!(gmodule=g_module_open (scope, G_MODULE_BIND_LAZY))) {
478                         g_warning ("Failed to load library %s (%s)", full_name, scope);
479                         g_free (full_name);
480                         return;
481                 }
482         }
483         g_free (full_name);
484
485         g_module_symbol (gmodule, import, &mh->addr); 
486
487         if (!mh->addr) {
488                 g_warning ("Failed to load function %s from %s", import, scope);
489                 return;
490         }
491
492         mh->flags |= METHOD_ATTRIBUTE_PINVOKE_IMPL;
493 }
494
495 MonoMethod *
496 mono_get_method (MonoImage *image, guint32 token, MonoClass *klass)
497 {
498         MonoMethod *result;
499         int table = mono_metadata_token_table (token);
500         int index = mono_metadata_token_index (token);
501         MonoTableInfo *tables = image->tables;
502         const char *loc, *sig = NULL;
503         char *name;
504         int size;
505         guint32 cols [MONO_TYPEDEF_SIZE];
506
507         if ((result = g_hash_table_lookup (image->method_cache, GINT_TO_POINTER (token))))
508                         return result;
509
510         if (table != MONO_TABLE_METHOD) {
511                 g_assert (table == MONO_TABLE_MEMBERREF);
512                 result = method_from_memberref (image, index);
513                 g_hash_table_insert (image->method_cache, GINT_TO_POINTER (token), result);
514                 return result;
515         }
516
517         mono_metadata_decode_row (&tables [table], index - 1, cols, 6);
518
519         if ((cols [2] & METHOD_ATTRIBUTE_PINVOKE_IMPL) ||
520             (cols [1] & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL))
521                 result = (MonoMethod *)g_new0 (MonoMethodPInvoke, 1);
522         else 
523                 result = (MonoMethod *)g_new0 (MonoMethodNormal, 1);
524         
525         result->slot = -1;
526         result->klass = klass;
527         result->flags = cols [2];
528         result->iflags = cols [1];
529         result->name = mono_metadata_string_heap (image, cols [3]);
530
531         if (!sig) /* already taken from the methodref */
532                 sig = mono_metadata_blob_heap (image, cols [4]);
533         size = mono_metadata_decode_blob_size (sig, &sig);
534         result->signature = mono_metadata_parse_method_signature (image, 0, sig, NULL);
535
536         if (!result->klass) {
537                 guint32 type = mono_metadata_typedef_from_method (image, token);
538                 result->klass = mono_class_get (image, MONO_TOKEN_TYPE_DEF | type);
539         }
540
541         if (cols [1] & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL) {
542                 name = g_strconcat (result->klass->name_space, ".", result->klass->name, "::", 
543                                     mono_metadata_string_heap (image, cols [MONO_METHOD_NAME]), NULL);
544                 result->addr = mono_lookup_internal_call (name);
545                 g_free (name);
546                 result->flags |= METHOD_ATTRIBUTE_PINVOKE_IMPL;
547         } else if (cols [2] & METHOD_ATTRIBUTE_PINVOKE_IMPL) {
548                 fill_pinvoke_info (image, (MonoMethodPInvoke *)result, index - 1);
549         } else {
550                 /* if this is a methodref from another module/assembly, this fails */
551                 loc = mono_cli_rva_map ((MonoCLIImageInfo *)image->image_info, cols [0]);
552
553                 if (!result->klass->dummy && !(result->flags & METHOD_ATTRIBUTE_ABSTRACT) &&
554                                         !(result->iflags & METHOD_IMPL_ATTRIBUTE_RUNTIME)) {
555                         g_assert (loc);
556                         ((MonoMethodNormal *)result)->header = mono_metadata_parse_mh (image, loc);
557                 }
558         }
559
560         g_hash_table_insert (image->method_cache, GINT_TO_POINTER (token), result);
561
562         return result;
563 }
564
565 void
566 mono_free_method  (MonoMethod *method)
567 {
568         mono_metadata_free_method_signature (method->signature);
569         if (method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL) {
570                 MonoMethodPInvoke *piinfo = (MonoMethodPInvoke *)method;
571                 g_free (piinfo->code);
572         } else if (!(method->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL)) {
573                 mono_metadata_free_mh (((MonoMethodNormal *)method)->header);
574         }
575
576         g_free (method);
577 }
578
579 void
580 mono_method_get_param_names (MonoMethod *method, const char **names)
581 {
582         int i, lastp;
583         MonoClass *klass = method->klass;
584         MonoTableInfo *methodt = &klass->image->tables [MONO_TABLE_METHOD];
585         MonoTableInfo *paramt = &klass->image->tables [MONO_TABLE_PARAM];
586
587         if (!method->signature->param_count)
588                 return;
589         for (i = 0; i < method->signature->param_count; ++i)
590                 names [i] = "";
591
592         mono_class_metadata_init (klass);
593         if (!klass->methods)
594                 return;
595
596         for (i = 0; i < klass->method.count; ++i) {
597                 if (method == klass->methods [i]) {
598                         guint32 index = klass->method.first + i;
599                         guint32 cols [MONO_PARAM_SIZE];
600                         guint param_index = mono_metadata_decode_row_col (methodt, index, MONO_METHOD_PARAMLIST);
601
602                         if (index < methodt->rows)
603                                 lastp = mono_metadata_decode_row_col (methodt, index + 1, MONO_METHOD_PARAMLIST);
604                         else
605                                 lastp = paramt->rows;
606                         for (i = param_index; i < lastp; ++i) {
607                                 mono_metadata_decode_row (paramt, i -1, cols, MONO_PARAM_SIZE);
608                                 if (cols [MONO_PARAM_SEQUENCE]) /* skip return param spec */
609                                         names [cols [MONO_PARAM_SEQUENCE] - 1] = mono_metadata_string_heap (klass->image, cols [MONO_PARAM_NAME]);
610                         }
611                         return;
612                 }
613         }
614 }
615