51bf71e41a4f8e595ff8c8f9d70f4f4c8f78a022
[mono.git] / mono / metadata / class-internals.h
1 #ifndef __MONO_METADATA_CLASS_INTERBALS_H__
2 #define __MONO_METADATA_CLASS_INTERBALS_H__
3
4 #include <mono/metadata/class.h>
5 #include <mono/metadata/object.h>
6 #include <mono/io-layer/io-layer.h>
7
8 #define MONO_CLASS_IS_ARRAY(c) ((c)->rank)
9
10 #define MONO_DEFAULT_SUPERTABLE_SIZE 6
11
12 extern gboolean mono_print_vtable;
13
14 typedef void     (*MonoStackWalkImpl) (MonoStackWalk func, gboolean do_il_offset, gpointer user_data);
15
16 typedef struct _MonoMethodNormal MonoMethodNormal;
17 typedef struct _MonoMethodWrapper MonoMethodWrapper;
18 typedef struct _MonoMethodInflated MonoMethodInflated;
19 typedef struct _MonoMethodPInvoke MonoMethodPInvoke;
20
21 /*
22  * remember to update wrapper_type_names if you change something here
23  */
24 typedef enum {
25         MONO_WRAPPER_NONE,
26         MONO_WRAPPER_DELEGATE_INVOKE,
27         MONO_WRAPPER_DELEGATE_BEGIN_INVOKE,
28         MONO_WRAPPER_DELEGATE_END_INVOKE,
29         MONO_WRAPPER_RUNTIME_INVOKE,
30         MONO_WRAPPER_NATIVE_TO_MANAGED,
31         MONO_WRAPPER_MANAGED_TO_NATIVE,
32         MONO_WRAPPER_REMOTING_INVOKE,
33         MONO_WRAPPER_REMOTING_INVOKE_WITH_CHECK,
34         MONO_WRAPPER_XDOMAIN_INVOKE,
35         MONO_WRAPPER_XDOMAIN_DISPATCH,
36         MONO_WRAPPER_LDFLD,
37         MONO_WRAPPER_STFLD,
38         MONO_WRAPPER_LDFLD_REMOTE,
39         MONO_WRAPPER_STFLD_REMOTE,
40         MONO_WRAPPER_SYNCHRONIZED,
41         MONO_WRAPPER_DYNAMIC_METHOD,
42         MONO_WRAPPER_ISINST,
43         MONO_WRAPPER_CASTCLASS,
44         MONO_WRAPPER_PROXY_ISINST,
45         MONO_WRAPPER_STELEMREF,
46         MONO_WRAPPER_UNBOX,
47         MONO_WRAPPER_LDFLDA,
48         MONO_WRAPPER_UNKNOWN
49 } MonoWrapperType;
50
51 typedef enum {
52         MONO_TYPE_NAME_FORMAT_IL,
53         MONO_TYPE_NAME_FORMAT_REFLECTION,
54         MONO_TYPE_NAME_FORMAT_FULL_NAME,
55         MONO_TYPE_NAME_FORMAT_ASSEMBLY_QUALIFIED
56 } MonoTypeNameFormat;
57
58 typedef enum {
59         MONO_REMOTING_TARGET_UNKNOWN,
60         MONO_REMOTING_TARGET_APPDOMAIN
61 } MonoRemotingTarget;
62
63 struct _MonoMethod {
64         guint16 flags;  /* method flags */
65         guint16 iflags; /* method implementation flags */
66         guint32 token;
67         MonoClass *klass;
68         MonoMethodSignature *signature;
69         MonoGenericContainer *generic_container;
70         /* name is useful mostly for debugging */
71         const char *name;
72         /* this is used by the inlining algorithm */
73         unsigned int inline_info:1;
74         unsigned int uses_this:1;
75         unsigned int wrapper_type:5;
76         unsigned int string_ctor:1;
77         unsigned int save_lmf:1;
78         unsigned int dynamic:1; /* created & destroyed during runtime */
79         unsigned int is_inflated:1; /* whether we're a MonoMethodInflated */
80         signed int slot : 21;
81 };
82
83 struct _MonoMethodNormal {
84         MonoMethod method;
85         MonoMethodHeader *header;
86 };
87
88 struct _MonoMethodWrapper {
89         MonoMethodNormal method;
90         void *method_data;
91 };
92
93 struct _MonoMethodPInvoke {
94         MonoMethod method;
95         gpointer addr;
96         /* add marshal info */
97         guint16 piflags;  /* pinvoke flags */
98         guint16 implmap_idx;  /* index into IMPLMAP */
99 };
100
101 /*
102  * Inflated generic method.
103  */
104 struct _MonoMethodInflated {
105         union {
106                 MonoMethod method;
107                 MonoMethodNormal normal;
108                 MonoMethodPInvoke pinvoke;
109         } method;
110         MonoGenericContext *context;    /* The current context. */
111         MonoMethod *declaring;          /* the generic method definition. */
112         /* This is a big performance optimization:
113          *
114          * mono_class_inflate_generic_method() just creates a copy of the method
115          * and computes its new context, but it doesn't actually inflate the
116          * method's signature and header.  Very often, we don't actually need them
117          * (for instance because the method is stored in a class'es vtable).
118          *
119          * If the `inflated' field in non-NULL, mono_get_inflated_method() already
120          * inflated the signature and header and stored it there.
121          */
122         MonoMethodInflated *inflated;
123 };
124
125 typedef struct {
126         MonoType *generic_type;
127         gpointer reflection_info;
128 } MonoInflatedField;
129
130 /*
131  * MonoClassField is just a runtime representation of the metadata for
132  * field, it doesn't contain the data directly.  Static fields are
133  * stored in MonoVTable->data.  Instance fields are allocated in the
134  * objects after the object header.
135  */
136 struct _MonoClassField {
137         /* Type of the field */
138         MonoType        *type;
139
140         /* If this is an instantiated generic type, this is the
141          * "original" type, ie. the MONO_TYPE_VAR or MONO_TYPE_GENERICINST
142          * it was instantiated from.
143          */
144         MonoInflatedField  *generic_info;
145
146         /*
147          * Offset where this field is stored; if it is an instance
148          * field, it's the offset from the start of the object, if
149          * it's static, it's from the start of the memory chunk
150          * allocated for statics for the class.
151          */
152         int              offset;
153
154         const char      *name;
155
156         /*
157          * If the field is constant, pointer to the metadata constant
158          * value.
159          * If the field has an RVA flag, pointer to the data.
160          * Else, invalid.
161          */
162         const char      *data;
163
164         /* Type where the field was defined */
165         MonoClass       *parent;
166
167         /*
168          * If the field is constant, the type of the constant.
169          */
170         MonoTypeEnum     def_type;
171 };
172
173 /* a field is ignored if it's named "_Deleted" and it has the specialname and rtspecialname flags set */
174 #define mono_field_is_deleted(field) (((field)->type->attrs & (FIELD_ATTRIBUTE_SPECIAL_NAME | FIELD_ATTRIBUTE_RT_SPECIAL_NAME)) \
175                                       && (strcmp ((field)->name, "_Deleted") == 0))
176
177 typedef struct {
178         MonoClassField *field;
179         guint32 offset;
180         MonoMarshalSpec *mspec;
181 } MonoMarshalField;
182
183 typedef struct {
184         guint32 native_size;
185         guint32 num_fields;
186         MonoMethod *ptr_to_str;
187         MonoMethod *str_to_ptr;
188         MonoMarshalField fields [MONO_ZERO_LEN_ARRAY];
189 } MonoMarshalType;
190
191 struct _MonoProperty {
192         MonoClass *parent;
193         const char *name;
194         MonoMethod *get;
195         MonoMethod *set;
196         guint32 attrs;
197 };
198
199 struct _MonoEvent {
200         MonoClass *parent;
201         const char *name;
202         MonoMethod *add;
203         MonoMethod *remove;
204         MonoMethod *raise;
205         MonoMethod **other;
206         guint32 attrs;
207 };
208
209 /* type of exception being "on hold" for later processing (see exception_type) */
210 enum {
211         MONO_EXCEPTION_NONE = 0,
212         MONO_EXCEPTION_SECURITY_LINKDEMAND = 1,
213         MONO_EXCEPTION_SECURITY_INHERITANCEDEMAND = 2,
214         MONO_EXCEPTION_INVALID_PROGRAM = 3,
215         MONO_EXCEPTION_UNVERIFIABLE_IL = 4,
216         MONO_EXCEPTION_MISSING_METHOD = 5,
217         MONO_EXCEPTION_MISSING_FIELD = 6,
218         MONO_EXCEPTION_TYPE_LOAD = 7
219         /* add other exception type */
220 };
221
222 /* This struct collects the info needed for the runtime use of a class,
223  * like the vtables for a domain, the GC descriptor, etc.
224  */
225 typedef struct {
226         guint16 max_domain;
227         /* domain_vtables is indexed by the domain id and the size is max_domain + 1 */
228         MonoVTable *domain_vtables [MONO_ZERO_LEN_ARRAY];
229 } MonoClassRuntimeInfo;
230
231 struct _MonoClass {
232         MonoImage *image;
233
234         /* The underlying type of the enum */
235         MonoType *enum_basetype;
236         /* element class for arrays and enum */
237         MonoClass *element_class; 
238         /* used for subtype checks */
239         MonoClass *cast_class; 
240         /* array dimension */
241         guint8     rank;          
242
243         guint inited          : 1;
244         /* We use init_pending to detect cyclic calls to mono_class_init */
245         guint init_pending    : 1;
246
247         /* A class contains static and non static data. Static data can be
248          * of the same type as the class itselfs, but it does not influence
249          * the instance size of the class. To avoid cyclic calls to 
250          * mono_class_init (from mono_class_instance_size ()) we first 
251          * initialise all non static fields. After that we set size_inited 
252          * to 1, because we know the instance size now. After that we 
253          * initialise all static fields.
254          */
255         guint size_inited     : 1;
256         guint valuetype       : 1; /* derives from System.ValueType */
257         guint enumtype        : 1; /* derives from System.Enum */
258         guint blittable       : 1; /* class is blittable */
259         guint unicode         : 1; /* class uses unicode char when marshalled */
260         guint wastypebuilder  : 1; /* class was created at runtime from a TypeBuilder */
261         /* next byte */
262         guint min_align       : 4;
263         guint packing_size    : 4;
264         /* next byte */
265         guint ghcimpl         : 1; /* class has its own GetHashCode impl */ 
266         guint has_finalize    : 1; /* class has its own Finalize impl */ 
267         guint marshalbyref    : 1; /* class is a MarshalByRefObject */
268         guint contextbound    : 1; /* class is a ContextBoundObject */
269         guint delegate        : 1; /* class is a Delegate */
270         guint gc_descr_inited : 1; /* gc_descr is initialized */
271         guint has_cctor       : 1; /* class has a cctor */
272         guint dummy           : 1; /* temporary hack */
273         /* next byte */
274         guint has_references  : 1; /* it has GC-tracked references in the instance */
275         guint has_static_refs : 1; /* it has static fields that are GC-tracked */
276         guint no_special_static_fields : 1; /* has no thread/context static fields */
277
278         guint8     exception_type;      /* MONO_EXCEPTION_* */
279         void*      exception_data;      /* Additional information about the exception */
280         guint32    declsec_flags;       /* declarative security attributes flags */
281
282         MonoClass  *parent;
283         MonoClass  *nested_in;
284         GList      *nested_classes;
285
286         guint32    type_token;
287         const char *name;
288         const char *name_space;
289         
290         /* for fast subtype checks */
291         MonoClass **supertypes;
292         guint16     idepth;
293
294         guint16     interface_count;
295         guint16     interface_id;        /* unique inderface id (for interfaces) */
296         guint16     max_interface_id;
297         gint       *interface_offsets;   
298         MonoClass **interfaces;
299
300         /*
301          * Computed object instance size, total.
302          */
303         int        instance_size;
304         int        class_size;
305         int        vtable_size; /* number of slots */
306
307         /*
308          * From the TypeDef table
309          */
310         guint32    flags;
311         struct {
312                 guint32 first, count;
313         } field, method, property, event;
314
315         /* loaded on demand */
316         MonoMarshalType *marshal_info;
317
318         /*
319          * Field information: Type and location from object base
320          */
321         MonoClassField *fields;
322
323         /* Initialized by a call to mono_class_setup_properties () */
324         MonoProperty *properties;
325
326         /* Initialized by a call to mono_class_setup_events () */
327         MonoEvent *events;
328
329         MonoMethod **methods;
330
331         /* used as the type of the this argument and when passing the arg by value */
332         MonoType this_arg;
333         MonoType byval_arg;
334
335         MonoGenericClass *generic_class;
336         MonoGenericContainer *generic_container;
337
338         void *reflection_info;
339
340         void *gc_descr;
341
342         MonoClassRuntimeInfo *runtime_info;
343
344         /* Generic vtable. Initialized by a call to mono_class_setup_vtable () */
345         MonoMethod **vtable;    
346 };
347
348 struct MonoVTable {
349         MonoClass  *klass;
350     /*
351          * According to comments in gc_gcj.h, this should be the second word in
352          * the vtable.
353          */
354         void *gc_descr;         
355         MonoDomain *domain;  /* each object/vtable belongs to exactly one domain */
356         gpointer   *interface_offsets;   
357         gpointer    data; /* to store static class data */
358         gpointer    type; /* System.Type type for klass */
359         guint16     max_interface_id;
360         guint8      rank;
361         guint remote          : 1; /* class is remotely activated */
362         guint initialized     : 1; /* cctor has been run */
363         /* do not add any fields after vtable, the structure is dynamically extended */
364         gpointer    vtable [MONO_ZERO_LEN_ARRAY];       
365 };
366
367 /*
368  * Generic instantiation data type encoding.
369  */
370
371 /*
372  * A particular generic instantiation:
373  *
374  * All instantiations are cached and we don't distinguish between class and method
375  * instantiations here.
376  */
377 struct _MonoGenericInst {
378         guint id;                       /* unique ID for debugging */
379         guint type_argc    : 22;        /* number of type arguments */
380         guint is_open      :  1;        /* if this is an open type */
381         guint is_reference :  1;        /* if this is a reference type */
382         MonoType **type_argv;
383 };
384
385 /*
386  * A particular instantiation of a generic type.
387  */
388 struct _MonoGenericClass {
389         MonoGenericInst *inst;          /* the instantiation */
390         MonoClass *container_class;     /* the generic type definition */
391         MonoGenericContext *context;    /* current context */
392         guint is_dynamic  : 1;          /* We're a MonoDynamicGenericClass */
393         guint is_inflated : 1;          /* We're a MonoInflatedGenericClass */
394 };
395
396 /*
397  * Performance optimization:
398  * We don't create the `MonoClass' for a `MonoGenericClass' until we really
399  * need it.
400  */
401 struct _MonoInflatedGenericClass {
402         MonoGenericClass generic_class;
403         guint is_initialized   : 1;
404         MonoClass *klass;
405 };
406
407 /*
408  * This is used when instantiating a generic type definition which is
409  * a TypeBuilder.
410  */
411 struct _MonoDynamicGenericClass {
412         MonoInflatedGenericClass generic_class;
413         MonoType *parent;
414         int count_methods;
415         MonoMethod **methods;
416         int count_ctors;
417         MonoMethod **ctors;
418         int count_fields;
419         MonoClassField *fields;
420         int count_properties;
421         MonoProperty *properties;
422         int count_events;
423         MonoEvent *events;
424         guint initialized;
425 };
426
427 /*
428  * A particular instantiation of a generic method.
429  */
430 struct _MonoGenericMethod {
431         MonoGenericInst *inst;                  /* the instantiation */
432         MonoGenericClass *generic_class;        /* if we're in a generic type */
433         MonoGenericContainer *container;        /* type parameters */
434         gpointer reflection_info;
435 };
436
437 /*
438  * The generic context.
439  */
440 struct _MonoGenericContext {
441         /*
442          * The current container:
443          *
444          * If we're in a generic method, the generic method definition's container.
445          * Otherwise the generic type's container.
446          */
447         MonoGenericContainer *container;
448         /* The current generic class */
449         MonoGenericClass *gclass;
450         /* The current generic method */
451         MonoGenericMethod *gmethod;
452 };
453
454 /*
455  * The generic container.
456  *
457  * Stores the type parameters of a generic type definition or a generic method definition.
458  */
459 struct _MonoGenericContainer {
460         MonoGenericContext context;
461         /* If we're a generic method definition, the containing class'es context. */
462         MonoGenericContainer *parent;
463         /* If we're a generic method definition, caches all their instantiations. */
464         GHashTable *method_hash;
465         /* If we're a generic type definition, its `MonoClass'. */
466         MonoClass *klass;
467         int type_argc    : 6;
468         /* If true, we're a generic method, otherwise a generic type definition. */
469         int is_method    : 1;
470         /* Our type parameters. */
471         MonoGenericParam *type_params;
472         /* Cache for MonoTypes */
473         MonoType **types;
474 };
475
476 /*
477  * A type parameter.
478  */
479 struct _MonoGenericParam {
480         MonoGenericContainer *owner;    /* Type or method this parameter was defined in. */
481         MonoClass *pklass;              /* The corresponding `MonoClass'. */
482         MonoMethod *method;             /* If we're a method type parameter, the method. */
483         const char *name;
484         guint16 flags;
485         guint16 num;
486         MonoClass** constraints; /* NULL means end of list */
487 };
488
489 /*
490  * Class information which might be cached by the runtime in the AOT file for
491  * example. Caching this allows us to avoid computing a generic vtable
492  * (class->vtable) in most cases, saving time and avoiding creation of lots of
493  * MonoMethod structures.
494  */
495 typedef struct MonoCachedClassInfo {
496         guint32 vtable_size;
497         guint has_finalize : 1;
498         guint ghcimpl : 1;
499         guint has_cctor : 1;
500         guint has_nested_classes : 1;
501         guint blittable : 1;
502         guint has_references : 1;
503         guint has_static_refs : 1;
504         guint no_special_static_fields : 1;
505         guint32 cctor_token;
506         MonoImage *finalize_image;
507         guint32 finalize_token;
508         guint32 instance_size;
509         guint32 class_size;
510         guint32 packing_size;
511         guint32 min_align;
512 } MonoCachedClassInfo;
513
514 typedef struct {
515         const char *name;
516         gconstpointer func;
517         gconstpointer wrapper;
518         MonoMethodSignature *sig;
519 } MonoJitICallInfo;
520
521 /*
522  * Information about a type load error encountered by the loader.
523  */
524 typedef enum {
525         MONO_LOADER_ERROR_TYPE,
526         MONO_LOADER_ERROR_METHOD,
527         MONO_LOADER_ERROR_FIELD
528 } MonoLoaderErrorKind;
529
530 typedef struct {
531         MonoLoaderErrorKind kind;
532         char *class_name, *assembly_name; /* If kind == TYPE */
533         MonoClass *klass; /* If kind != TYPE */
534         const char *member_name; /* If kind != TYPE */
535 } MonoLoaderError;
536
537 #define mono_class_has_parent(klass,parent) (((klass)->idepth >= (parent)->idepth) && ((klass)->supertypes [(parent)->idepth - 1] == (parent)))
538
539 typedef struct {
540         gulong new_object_count;
541         gulong initialized_class_count;
542         gulong used_class_count;
543         gulong class_vtable_size;
544         gulong class_static_data_size;
545         gulong generic_instance_count;
546         gulong generic_class_count;
547         gulong inflated_method_count;
548         gulong inflated_method_count_2;
549         gulong inflated_type_count;
550         gulong generics_metadata_size;
551         gboolean enabled;
552 } MonoStats;
553
554 extern MonoStats mono_stats;
555
556 typedef gpointer (*MonoTrampoline)       (MonoMethod *method);
557 typedef gpointer (*MonoRemotingTrampoline)       (MonoMethod *method, MonoRemotingTarget target);
558 typedef gpointer (*MonoDelegateTrampoline)       (MonoMethod *method, gpointer addr);
559
560 typedef gpointer (*MonoLookupDynamicToken) (MonoImage *image, guint32 token, MonoClass **handle_class);
561
562 typedef gboolean (*MonoGetCachedClassInfo) (MonoClass *klass, MonoCachedClassInfo *res);
563
564 void
565 mono_classes_init (void);
566
567 void
568 mono_class_layout_fields   (MonoClass *klass);
569
570 void
571 mono_class_setup_vtable_general (MonoClass *klass, MonoMethod **overrides, int onum);
572
573 void
574 mono_class_setup_vtable (MonoClass *klass);
575
576 void
577 mono_class_setup_methods (MonoClass *klass);
578
579 void
580 mono_class_setup_mono_type (MonoClass *klass);
581
582 void
583 mono_class_setup_parent    (MonoClass *klass, MonoClass *parent);
584
585 void
586 mono_class_setup_supertypes (MonoClass *klass);
587
588 GPtrArray*
589 mono_class_get_implemented_interfaces (MonoClass *klass);
590
591 gboolean
592 mono_class_is_open_constructed_type (MonoType *t);
593
594 gboolean
595 mono_class_get_overrides_full (MonoImage *image, guint32 type_token, MonoMethod ***overrides, gint32 *num_overrides,
596                                MonoGenericContext *generic_context);
597
598 MonoMethod*
599 mono_class_get_cctor (MonoClass *klass);
600
601 MonoMethod*
602 mono_class_get_finalizer (MonoClass *klass);
603
604 gboolean
605 mono_class_needs_cctor_run (MonoClass *klass, MonoMethod *caller);
606
607 gboolean
608 mono_class_has_special_static_fields (MonoClass *klass);
609
610 void
611 mono_install_trampoline (MonoTrampoline func);
612
613 void
614 mono_install_remoting_trampoline (MonoRemotingTrampoline func);
615
616 void
617 mono_install_delegate_trampoline (MonoDelegateTrampoline func);
618
619 gpointer
620 mono_lookup_dynamic_token (MonoImage *image, guint32 token);
621
622 gpointer
623 mono_lookup_dynamic_token_class (MonoImage *image, guint32 token, MonoClass **handle_class);
624
625 void
626 mono_install_lookup_dynamic_token (MonoLookupDynamicToken func);
627
628 void
629 mono_install_get_cached_class_info (MonoGetCachedClassInfo func);
630
631 MonoInflatedGenericClass*
632 mono_get_inflated_generic_class (MonoGenericClass *gclass);
633
634 typedef struct {
635         MonoImage *corlib;
636         MonoClass *object_class;
637         MonoClass *byte_class;
638         MonoClass *void_class;
639         MonoClass *boolean_class;
640         MonoClass *sbyte_class;
641         MonoClass *int16_class;
642         MonoClass *uint16_class;
643         MonoClass *int32_class;
644         MonoClass *uint32_class;
645         MonoClass *int_class;
646         MonoClass *uint_class;
647         MonoClass *int64_class;
648         MonoClass *uint64_class;
649         MonoClass *single_class;
650         MonoClass *double_class;
651         MonoClass *char_class;
652         MonoClass *string_class;
653         MonoClass *enum_class;
654         MonoClass *array_class;
655         MonoClass *delegate_class;
656         MonoClass *multicastdelegate_class;
657         MonoClass *asyncresult_class;
658         MonoClass *waithandle_class;
659         MonoClass *typehandle_class;
660         MonoClass *fieldhandle_class;
661         MonoClass *methodhandle_class;
662         MonoClass *monotype_class;
663         MonoClass *exception_class;
664         MonoClass *threadabortexception_class;
665         MonoClass *thread_class;
666         MonoClass *transparent_proxy_class;
667         MonoClass *real_proxy_class;
668         MonoClass *mono_method_message_class;
669         MonoClass *appdomain_class;
670         MonoClass *field_info_class;
671         MonoClass *method_info_class;
672         MonoClass *stringbuilder_class;
673         MonoClass *math_class;
674         MonoClass *stack_frame_class;
675         MonoClass *stack_trace_class;
676         MonoClass *marshal_class;
677         MonoClass *iserializeable_class;
678         MonoClass *serializationinfo_class;
679         MonoClass *streamingcontext_class;
680         MonoClass *typed_reference_class;
681         MonoClass *argumenthandle_class;
682         MonoClass *marshalbyrefobject_class;
683         MonoClass *monitor_class;
684         MonoClass *iremotingtypeinfo_class;
685         MonoClass *runtimesecurityframe_class;
686         MonoClass *executioncontext_class;
687         MonoClass *generic_array_class;
688         MonoClass *generic_nullable_class;
689 } MonoDefaults;
690
691 extern MonoDefaults mono_defaults;
692
693 void
694 mono_loader_init           (void);
695
696 void
697 mono_loader_lock           (void);
698
699 void
700 mono_loader_unlock         (void);
701
702 void
703 mono_loader_set_error_type_load (char *class_name, char *assembly_name);
704
705 void
706 mono_loader_set_error_method_load (MonoClass *klass, const char *member_name);
707
708 void
709 mono_loader_set_error_field_load (MonoClass *klass, const char *member_name);
710
711 MonoLoaderError*
712 mono_loader_get_last_error (void);
713
714 void
715 mono_loader_clear_error    (void);
716
717 void 
718 mono_icall_init            (void);
719
720 void
721 mono_icall_cleanup         (void);
722
723 gpointer
724 mono_method_get_wrapper_data (MonoMethod *method, guint32 id);
725
726 void
727 mono_install_stack_walk (MonoStackWalkImpl func);
728
729 gboolean
730 mono_metadata_has_generic_params (MonoImage *image, guint32 token);
731
732 MonoGenericContainer *
733 mono_metadata_load_generic_params (MonoImage *image, guint32 token,
734                                    MonoGenericContainer *parent_container);
735
736 void
737 mono_metadata_load_generic_param_constraints (MonoImage *image, guint32 token,
738                                               MonoGenericContainer *container);
739
740 MonoMethodSignature*
741 mono_create_icall_signature (const char *sigstr);
742
743 MonoJitICallInfo *
744 mono_register_jit_icall (gconstpointer func, const char *name, MonoMethodSignature *sig, gboolean is_save);
745
746 void
747 mono_register_jit_icall_wrapper (MonoJitICallInfo *info, gconstpointer wrapper);
748
749 MonoJitICallInfo *
750 mono_find_jit_icall_by_name (const char *name);
751
752 MonoJitICallInfo *
753 mono_find_jit_icall_by_addr (gconstpointer addr);
754
755 MonoMethodSignature*
756 mono_class_inflate_generic_signature (MonoImage *image, MonoMethodSignature *sig, MonoGenericContext *context);
757
758 MonoMethodSignature *
759 mono_method_signature_full (MonoMethod *image, MonoGenericContainer *container);
760
761 MonoGenericClass *
762 mono_get_shared_generic_class (MonoGenericContainer *container, gboolean is_dynamic);
763
764 gboolean
765 mono_class_set_failure (MonoClass *klass, guint32 ex_type, void *ex_data);
766
767 MonoException*
768 mono_class_get_exception_for_failure (MonoClass *klass);
769
770 char*
771 mono_type_get_name_full (MonoType *type, MonoTypeNameFormat format);
772
773 char*
774 mono_type_get_full_name (MonoClass *class);
775
776 MonoArrayType *mono_dup_array_type (MonoArrayType *a);
777 MonoMethodSignature *mono_metadata_signature_deep_dup (MonoMethodSignature *sig);
778
779 gboolean mono_class_is_nullable (MonoClass *klass);
780 MonoClass *mono_class_get_nullable_param (MonoClass *klass);
781
782 #endif /* __MONO_METADATA_CLASS_INTERBALS_H__ */
783