Set `vtable->init_aborted' if we hit a `ThreadAbortException' in the class .cctor.
[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/metadata/mempool.h>
7 #include <mono/metadata/metadata-internals.h>
8 #include <mono/io-layer/io-layer.h>
9 #include "mono/utils/mono-compiler.h"
10 #include "mono/utils/mono-error.h"
11
12 #define MONO_CLASS_IS_ARRAY(c) ((c)->rank)
13
14 #define MONO_CLASS_HAS_STATIC_METADATA(klass) ((klass)->type_token && !(klass)->image->dynamic && !(klass)->generic_class)
15
16 #define MONO_DEFAULT_SUPERTABLE_SIZE 6
17
18 extern gboolean mono_print_vtable;
19
20 typedef void     (*MonoStackWalkImpl) (MonoStackWalk func, gboolean do_il_offset, gpointer user_data);
21
22 typedef struct _MonoMethodNormal MonoMethodNormal;
23 typedef struct _MonoMethodWrapper MonoMethodWrapper;
24 typedef struct _MonoMethodInflated MonoMethodInflated;
25 typedef struct _MonoMethodPInvoke MonoMethodPInvoke;
26
27 /* Properties that applies to a group of structs should better use a higher number
28  * to avoid colision with type specific properties.
29  * 
30  * This prop applies to class, method, property, event, assembly and image.
31  */
32 #define MONO_PROP_DYNAMIC_CATTR 0x1000
33
34 typedef enum {
35 #define WRAPPER(e,n) MONO_WRAPPER_ ## e,
36 #include "wrapper-types.h"
37 #undef WRAPPER
38         MONO_WRAPPER_NUM
39 } MonoWrapperType;
40
41 typedef enum {
42         MONO_TYPE_NAME_FORMAT_IL,
43         MONO_TYPE_NAME_FORMAT_REFLECTION,
44         MONO_TYPE_NAME_FORMAT_FULL_NAME,
45         MONO_TYPE_NAME_FORMAT_ASSEMBLY_QUALIFIED
46 } MonoTypeNameFormat;
47
48 typedef enum {
49         MONO_REMOTING_TARGET_UNKNOWN,
50         MONO_REMOTING_TARGET_APPDOMAIN,
51         MONO_REMOTING_TARGET_COMINTEROP
52 } MonoRemotingTarget;
53
54 #define MONO_METHOD_PROP_GENERIC_CONTAINER 0
55
56 struct _MonoMethod {
57         guint16 flags;  /* method flags */
58         guint16 iflags; /* method implementation flags */
59         guint32 token;
60         MonoClass *klass;
61         MonoMethodSignature *signature;
62         /* name is useful mostly for debugging */
63         const char *name;
64         /* this is used by the inlining algorithm */
65         unsigned int inline_info:1;
66         unsigned int inline_failure:1;
67         unsigned int wrapper_type:5;
68         unsigned int string_ctor:1;
69         unsigned int save_lmf:1;
70         unsigned int dynamic:1; /* created & destroyed during runtime */
71         unsigned int is_generic:1; /* whenever this is a generic method definition */
72         unsigned int is_inflated:1; /* whether we're a MonoMethodInflated */
73         unsigned int skip_visibility:1; /* whenever to skip JIT visibility checks */
74         unsigned int verification_success:1; /* whether this method has been verified successfully.*/
75         /* TODO we MUST get rid of this field, it's an ugly hack nobody is proud of. */
76         unsigned int is_mb_open : 1;            /* This is the fully open instantiation of a generic method_builder. Worse than is_tb_open, but it's temporary */
77         signed int slot : 17;
78
79         /*
80          * If is_generic is TRUE, the generic_container is stored in image->property_hash, 
81          * using the key MONO_METHOD_PROP_GENERIC_CONTAINER.
82          */
83 };
84
85 struct _MonoMethodNormal {
86         MonoMethod method;
87         MonoMethodHeader *header;
88 };
89
90 struct _MonoMethodWrapper {
91         MonoMethodNormal method;
92         void *method_data;
93 };
94
95 struct _MonoMethodPInvoke {
96         MonoMethod method;
97         gpointer addr;
98         /* add marshal info */
99         guint16 piflags;  /* pinvoke flags */
100         guint16 implmap_idx;  /* index into IMPLMAP */
101 };
102
103 /* 
104  * Stores the default value / RVA of fields.
105  * This information is rarely needed, so it is stored separately from 
106  * MonoClassField.
107  */
108 typedef struct MonoFieldDefaultValue {
109         /*
110          * If the field is constant, pointer to the metadata constant
111          * value.
112          * If the field has an RVA flag, pointer to the data.
113          * Else, invalid.
114          */
115         const char      *data;
116
117         /* If the field is constant, the type of the constant. */
118         MonoTypeEnum     def_type;
119 } MonoFieldDefaultValue;
120
121 /*
122  * MonoClassField is just a runtime representation of the metadata for
123  * field, it doesn't contain the data directly.  Static fields are
124  * stored in MonoVTable->data.  Instance fields are allocated in the
125  * objects after the object header.
126  */
127 struct _MonoClassField {
128         /* Type of the field */
129         MonoType        *type;
130
131         const char      *name;
132
133         /* Type where the field was defined */
134         MonoClass       *parent;
135
136         /*
137          * Offset where this field is stored; if it is an instance
138          * field, it's the offset from the start of the object, if
139          * it's static, it's from the start of the memory chunk
140          * allocated for statics for the class.
141          * For special static fields, this is set to -1 during vtable construction.
142          */
143         int              offset;
144 };
145
146 /* a field is ignored if it's named "_Deleted" and it has the specialname and rtspecialname flags set */
147 #define mono_field_is_deleted(field) (((field)->type->attrs & (FIELD_ATTRIBUTE_SPECIAL_NAME | FIELD_ATTRIBUTE_RT_SPECIAL_NAME)) \
148                                       && (strcmp (mono_field_get_name (field), "_Deleted") == 0))
149
150 typedef struct {
151         MonoClassField *field;
152         guint32 offset;
153         MonoMarshalSpec *mspec;
154 } MonoMarshalField;
155
156 typedef struct {
157         guint32 native_size, min_align;
158         guint32 num_fields;
159         MonoMethod *ptr_to_str;
160         MonoMethod *str_to_ptr;
161         MonoMarshalField fields [MONO_ZERO_LEN_ARRAY];
162 } MonoMarshalType;
163
164 #define MONO_SIZEOF_MARSHAL_TYPE (offsetof (MonoMarshalType, fields))
165
166 struct _MonoProperty {
167         MonoClass *parent;
168         const char *name;
169         MonoMethod *get;
170         MonoMethod *set;
171         guint32 attrs;
172 };
173
174 struct _MonoEvent {
175         MonoClass *parent;
176         const char *name;
177         MonoMethod *add;
178         MonoMethod *remove;
179         MonoMethod *raise;
180         MonoMethod **other;
181         guint32 attrs;
182 };
183
184 /* type of exception being "on hold" for later processing (see exception_type) */
185 enum {
186         MONO_EXCEPTION_NONE = 0,
187         MONO_EXCEPTION_SECURITY_LINKDEMAND = 1,
188         MONO_EXCEPTION_SECURITY_INHERITANCEDEMAND = 2,
189         MONO_EXCEPTION_INVALID_PROGRAM = 3,
190         MONO_EXCEPTION_UNVERIFIABLE_IL = 4,
191         MONO_EXCEPTION_MISSING_METHOD = 5,
192         MONO_EXCEPTION_MISSING_FIELD = 6,
193         MONO_EXCEPTION_TYPE_LOAD = 7,
194         MONO_EXCEPTION_FILE_NOT_FOUND = 8,
195         MONO_EXCEPTION_METHOD_ACCESS = 9,
196         MONO_EXCEPTION_FIELD_ACCESS = 10,
197         MONO_EXCEPTION_GENERIC_SHARING_FAILED = 11,
198         MONO_EXCEPTION_BAD_IMAGE = 12,
199         MONO_EXCEPTION_OBJECT_SUPPLIED = 13 /*The exception object is already created.*/
200         /* add other exception type */
201 };
202
203 /* This struct collects the info needed for the runtime use of a class,
204  * like the vtables for a domain, the GC descriptor, etc.
205  */
206 typedef struct {
207         guint16 max_domain;
208         /* domain_vtables is indexed by the domain id and the size is max_domain + 1 */
209         MonoVTable *domain_vtables [MONO_ZERO_LEN_ARRAY];
210 } MonoClassRuntimeInfo;
211
212 #define MONO_SIZEOF_CLASS_RUNTIME_INFO (sizeof (MonoClassRuntimeInfo) - MONO_ZERO_LEN_ARRAY * SIZEOF_VOID_P)
213
214 enum {
215         MONO_RGCTX_INFO_STATIC_DATA,
216         MONO_RGCTX_INFO_KLASS,
217         MONO_RGCTX_INFO_VTABLE,
218         MONO_RGCTX_INFO_TYPE,
219         MONO_RGCTX_INFO_REFLECTION_TYPE,
220         MONO_RGCTX_INFO_METHOD,
221         MONO_RGCTX_INFO_GENERIC_METHOD_CODE,
222         MONO_RGCTX_INFO_CLASS_FIELD,
223         MONO_RGCTX_INFO_METHOD_RGCTX,
224         MONO_RGCTX_INFO_METHOD_CONTEXT,
225         MONO_RGCTX_INFO_REMOTING_INVOKE_WITH_CHECK,
226         MONO_RGCTX_INFO_METHOD_DELEGATE_CODE
227 };
228
229 typedef struct _MonoRuntimeGenericContextOtherInfoTemplate {
230         int info_type;
231         gpointer data;
232         struct _MonoRuntimeGenericContextOtherInfoTemplate *next;
233 } MonoRuntimeGenericContextOtherInfoTemplate;
234
235 typedef struct {
236         MonoClass *next_subclass;
237         MonoRuntimeGenericContextOtherInfoTemplate *other_infos;
238         GSList *method_templates;
239 } MonoRuntimeGenericContextTemplate;
240
241 typedef struct {
242         MonoVTable *class_vtable; /* must be the first element */
243         MonoGenericInst *method_inst;
244         gpointer infos [MONO_ZERO_LEN_ARRAY];
245 } MonoMethodRuntimeGenericContext;
246
247 #define MONO_SIZEOF_METHOD_RUNTIME_GENERIC_CONTEXT (sizeof (MonoMethodRuntimeGenericContext) - MONO_ZERO_LEN_ARRAY * SIZEOF_VOID_P)
248
249 #define MONO_RGCTX_SLOT_MAKE_RGCTX(i)   (i)
250 #define MONO_RGCTX_SLOT_MAKE_MRGCTX(i)  ((i) | 0x80000000)
251 #define MONO_RGCTX_SLOT_INDEX(s)        ((s) & 0x7fffffff)
252 #define MONO_RGCTX_SLOT_IS_MRGCTX(s)    (((s) & 0x80000000) ? TRUE : FALSE)
253
254
255 #define MONO_CLASS_PROP_EXCEPTION_DATA 0
256
257 /* 
258  * This structure contains the rarely used fields of MonoClass
259  * Since using just one field causes the whole structure to be allocated, it should
260  * be used for fields which are only used in like 5% of all classes.
261  */
262 typedef struct {
263         struct {
264                 guint32 first, count;
265         } property, event;
266
267         /* Initialized by a call to mono_class_setup_properties () */
268         MonoProperty *properties;
269
270         /* Initialized by a call to mono_class_setup_events () */
271         MonoEvent *events;
272
273         guint32    declsec_flags;       /* declarative security attributes flags */
274
275         /* Default values/RVA for fields */
276         /* Accessed using mono_class_get_field_default_value () / mono_field_get_data () */
277         MonoFieldDefaultValue *field_def_values;
278
279         GList      *nested_classes;
280 } MonoClassExt;
281
282 struct _MonoClass {
283         /* element class for arrays and enum basetype for enums */
284         MonoClass *element_class; 
285         /* used for subtype checks */
286         MonoClass *cast_class; 
287
288         /* for fast subtype checks */
289         MonoClass **supertypes;
290         guint16     idepth;
291
292         /* array dimension */
293         guint8     rank;          
294
295         int        instance_size; /* object instance size */
296
297         guint inited          : 1;
298         /* We use init_pending to detect cyclic calls to mono_class_init */
299         guint init_pending    : 1;
300
301         /* A class contains static and non static data. Static data can be
302          * of the same type as the class itselfs, but it does not influence
303          * the instance size of the class. To avoid cyclic calls to 
304          * mono_class_init (from mono_class_instance_size ()) we first 
305          * initialise all non static fields. After that we set size_inited 
306          * to 1, because we know the instance size now. After that we 
307          * initialise all static fields.
308          */
309         guint size_inited     : 1;
310         guint valuetype       : 1; /* derives from System.ValueType */
311         guint enumtype        : 1; /* derives from System.Enum */
312         guint blittable       : 1; /* class is blittable */
313         guint unicode         : 1; /* class uses unicode char when marshalled */
314         guint wastypebuilder  : 1; /* class was created at runtime from a TypeBuilder */
315         /* next byte */
316         guint8 min_align;
317         /* next byte */
318         guint packing_size    : 4;
319         /* still 4 bits free */
320         /* next byte */
321         guint ghcimpl         : 1; /* class has its own GetHashCode impl */ 
322         guint has_finalize    : 1; /* class has its own Finalize impl */ 
323         guint marshalbyref    : 1; /* class is a MarshalByRefObject */
324         guint contextbound    : 1; /* class is a ContextBoundObject */
325         guint delegate        : 1; /* class is a Delegate */
326         guint gc_descr_inited : 1; /* gc_descr is initialized */
327         guint has_cctor       : 1; /* class has a cctor */
328         guint has_references  : 1; /* it has GC-tracked references in the instance */
329         /* next byte */
330         guint has_static_refs : 1; /* it has static fields that are GC-tracked */
331         guint no_special_static_fields : 1; /* has no thread/context static fields */
332         /* directly or indirectly derives from ComImport attributed class.
333          * this means we need to create a proxy for instances of this class
334          * for COM Interop. set this flag on loading so all we need is a quick check
335          * during object creation rather than having to traverse supertypes
336          */
337         guint is_com_object : 1; 
338         guint nested_classes_inited : 1; /* Whenever nested_class is initialized */
339         guint interfaces_inited : 1; /* interfaces is initialized */
340         guint simd_type : 1; /* class is a simd intrinsic type */
341         guint is_generic : 1; /* class is a generic type definition */
342         guint is_inflated : 1; /* class is a generic instance */
343
344         guint8     exception_type;      /* MONO_EXCEPTION_* */
345
346         /* Additional information about the exception */
347         /* Stored as property MONO_CLASS_PROP_EXCEPTION_DATA */
348         //void       *exception_data;
349
350         MonoClass  *parent;
351         MonoClass  *nested_in;
352
353         MonoImage *image;
354         const char *name;
355         const char *name_space;
356
357         guint32    type_token;
358         int        vtable_size; /* number of slots */
359
360         guint16     interface_count;
361         guint16     interface_id;        /* unique inderface id (for interfaces) */
362         guint16     max_interface_id;
363         
364         guint16     interface_offsets_count;
365         MonoClass **interfaces_packed;
366         guint16    *interface_offsets_packed;
367         guint8     *interface_bitmap;
368         
369         MonoClass **interfaces;
370
371         union {
372                 int class_size; /* size of area for static fields */
373                 int element_size; /* for array types */
374                 int generic_param_token; /* for generic param types, both var and mvar */
375         } sizes;
376
377         /*
378          * From the TypeDef table
379          */
380         guint32    flags;
381         struct {
382                 guint32 first, count;
383         } field, method;
384
385         /* loaded on demand */
386         MonoMarshalType *marshal_info;
387
388         /*
389          * Field information: Type and location from object base
390          */
391         MonoClassField *fields;
392
393         MonoMethod **methods;
394
395         /* used as the type of the this argument and when passing the arg by value */
396         MonoType this_arg;
397         MonoType byval_arg;
398
399         MonoGenericClass *generic_class;
400         MonoGenericContainer *generic_container;
401
402         void *reflection_info;
403
404         void *gc_descr;
405
406         MonoClassRuntimeInfo *runtime_info;
407
408         /* next element in the class_cache hash list (in MonoImage) */
409         MonoClass *next_class_cache;
410
411         /* Generic vtable. Initialized by a call to mono_class_setup_vtable () */
412         MonoMethod **vtable;
413
414         /* Rarely used fields of classes */
415         MonoClassExt *ext;
416 };
417
418 #define MONO_CLASS_IMPLEMENTS_INTERFACE(k,uiid) (((uiid) <= (k)->max_interface_id) && ((k)->interface_bitmap [(uiid) >> 3] & (1 << ((uiid)&7))))
419 int mono_class_interface_offset (MonoClass *klass, MonoClass *itf);
420 int mono_class_interface_offset_with_variance (MonoClass *klass, MonoClass *itf, gboolean *non_exact_match) MONO_INTERNAL;
421
422 typedef gpointer MonoRuntimeGenericContext;
423
424 /* the interface_offsets array is stored in memory before this struct */
425 struct MonoVTable {
426         MonoClass  *klass;
427          /*
428          * According to comments in gc_gcj.h, this should be the second word in
429          * the vtable.
430          */
431         void *gc_descr;         
432         MonoDomain *domain;  /* each object/vtable belongs to exactly one domain */
433         gpointer    data; /* to store static class data */
434         gpointer    type; /* System.Type type for klass */
435         guint8     *interface_bitmap;
436         guint16     max_interface_id;
437         guint8      rank;
438         guint remote          : 1; /* class is remotely activated */
439         guint initialized     : 1; /* cctor has been run */
440         guint init_failed     : 1; /* cctor execution failed */
441         guint init_aborted    : 1; /* cctor execution aborted */
442         guint32     imt_collisions_bitmap;
443         MonoRuntimeGenericContext *runtime_generic_context;
444         /* do not add any fields after vtable, the structure is dynamically extended */
445         gpointer    vtable [MONO_ZERO_LEN_ARRAY];       
446 };
447
448 #define MONO_SIZEOF_VTABLE (sizeof (MonoVTable) - MONO_ZERO_LEN_ARRAY * SIZEOF_VOID_P)
449
450 #define MONO_VTABLE_IMPLEMENTS_INTERFACE(vt,uiid) (((uiid) <= (vt)->max_interface_id) && ((vt)->interface_bitmap [(uiid) >> 3] & (1 << ((uiid)&7))))
451
452 /*
453  * Generic instantiation data type encoding.
454  */
455
456 /*
457  * A particular generic instantiation:
458  *
459  * All instantiations are cached and we don't distinguish between class and method
460  * instantiations here.
461  */
462 struct _MonoGenericInst {
463         guint id;                       /* unique ID for debugging */
464         guint type_argc    : 22;        /* number of type arguments */
465         guint is_open      :  1;        /* if this is an open type */
466         MonoType *type_argv [MONO_ZERO_LEN_ARRAY];
467 };
468
469 #define MONO_SIZEOF_GENERIC_INST (sizeof (MonoGenericInst) - MONO_ZERO_LEN_ARRAY * SIZEOF_VOID_P)
470 /*
471  * The generic context: an instantiation of a set of class and method generic parameters.
472  *
473  * NOTE: Never allocate this directly on the heap.  It have to be either allocated on the stack,
474  *       or embedded within other objects.  Don't store pointers to this, because it may be on the stack.
475  *       If you really have to, ensure you store a pointer to the embedding object along with it.
476  */
477 struct _MonoGenericContext {
478         /* The instantiation corresponding to the class generic parameters */
479         MonoGenericInst *class_inst;
480         /* The instantiation corresponding to the method generic parameters */
481         MonoGenericInst *method_inst;
482 };
483
484 /*
485  * Inflated generic method.
486  */
487 struct _MonoMethodInflated {
488         union {
489                 MonoMethod method;
490                 MonoMethodNormal normal;
491                 MonoMethodPInvoke pinvoke;
492         } method;
493         MonoMethod *declaring;          /* the generic method definition. */
494         MonoGenericContext context;     /* The current instantiation */
495 };
496
497 /*
498  * A particular instantiation of a generic type.
499  */
500 struct _MonoGenericClass {
501         MonoClass *container_class;     /* the generic type definition */
502         MonoGenericContext context;     /* a context that contains the type instantiation doesn't contain any method instantiation */
503         guint is_dynamic  : 1;          /* We're a MonoDynamicGenericClass */
504         guint is_tb_open  : 1;          /* This is the fully open instantiation for a type_builder. Quite ugly, but it's temporary.*/
505         MonoClass *cached_class;        /* if present, the MonoClass corresponding to the instantiation.  */
506 };
507
508 /*
509  * This is used when instantiating a generic type definition which is
510  * a TypeBuilder.
511  */
512 struct _MonoDynamicGenericClass {
513         MonoGenericClass generic_class;
514         int count_methods;
515         MonoMethod **methods;
516         int count_ctors;
517         MonoMethod **ctors;
518         int count_fields;
519         MonoClassField *fields;
520         guint initialized;
521         /* The non-inflated types of the fields */
522         MonoType **field_generic_types;
523         /* The managed objects representing the fields */
524         MonoObject **field_objects;
525 };
526
527 /*
528  * A type parameter.
529  */
530 struct _MonoGenericParam {
531         MonoGenericContainer *owner;    /* Type or method this parameter was defined in. */
532         guint16 num;
533         /* 
534          * If owner is NULL, or owner is 'owned' by this gparam,
535          * then this is the image whose mempool this struct was allocated from.
536          * The second case happens for gparams created in
537          * mono_reflection_initialize_generic_parameter ().
538          */
539         MonoImage *image;
540 };
541
542 /* Additional details about a MonoGenericParam */
543 typedef struct {
544         MonoClass *pklass;              /* The corresponding `MonoClass'. */
545         const char *name;
546         guint16 flags;
547         guint32 token;
548         MonoClass** constraints; /* NULL means end of list */
549 } MonoGenericParamInfo;
550
551 typedef struct {
552         MonoGenericParam param;
553         MonoGenericParamInfo info;
554 } MonoGenericParamFull;
555
556 /*
557  * The generic container.
558  *
559  * Stores the type parameters of a generic type definition or a generic method definition.
560  */
561 struct _MonoGenericContainer {
562         MonoGenericContext context;
563         /* If we're a generic method definition in a generic type definition,
564            the generic container of the containing class. */
565         MonoGenericContainer *parent;
566         /* the generic type definition or the generic method definition corresponding to this container */
567         union {
568                 MonoClass *klass;
569                 MonoMethod *method;
570         } owner;
571         int type_argc    : 31;
572         /* If true, we're a generic method, otherwise a generic type definition. */
573         /* Invariant: parent != NULL => is_method */
574         int is_method    : 1;
575         /* Our type parameters. */
576         MonoGenericParamFull *type_params;
577
578         /* 
579          * For owner-less containers created by SRE, the image the container was
580          * allocated from.
581          */
582         MonoImage *image;
583 };
584
585 #define mono_generic_container_get_param(gc, i) ((MonoGenericParam *) ((gc)->type_params + (i)))
586 #define mono_generic_container_get_param_info(gc, i) (&((gc)->type_params + (i))->info)
587
588 #define mono_generic_param_owner(p)             ((p)->owner)
589 #define mono_generic_param_num(p)               ((p)->num)
590 #define mono_generic_param_info(p)              (mono_generic_param_owner (p) ? &((MonoGenericParamFull *) p)->info : NULL)
591 #define mono_type_get_generic_param_owner(t)    (mono_generic_param_owner ((t)->data.generic_param))
592 #define mono_type_get_generic_param_num(t)      (mono_generic_param_num   ((t)->data.generic_param))
593
594 /*
595  * Class information which might be cached by the runtime in the AOT file for
596  * example. Caching this allows us to avoid computing a generic vtable
597  * (class->vtable) in most cases, saving time and avoiding creation of lots of
598  * MonoMethod structures.
599  */
600 typedef struct MonoCachedClassInfo {
601         guint32 vtable_size;
602         guint has_finalize : 1;
603         guint ghcimpl : 1;
604         guint has_cctor : 1;
605         guint has_nested_classes : 1;
606         guint blittable : 1;
607         guint has_references : 1;
608         guint has_static_refs : 1;
609         guint no_special_static_fields : 1;
610         guint is_generic_container : 1;
611         guint32 cctor_token;
612         MonoImage *finalize_image;
613         guint32 finalize_token;
614         guint32 instance_size;
615         guint32 class_size;
616         guint32 packing_size;
617         guint32 min_align;
618 } MonoCachedClassInfo;
619
620 typedef struct {
621         const char *name;
622         gconstpointer func;
623         gconstpointer wrapper;
624         gconstpointer trampoline;
625         MonoMethodSignature *sig;
626 } MonoJitICallInfo;
627
628 typedef struct {
629         guint8 exception_type;
630         char *class_name; /* If kind == TYPE */
631         char *assembly_name; /* If kind == TYPE or ASSEMBLY */
632         MonoClass *klass; /* If kind != TYPE */
633         const char *member_name; /* If kind != TYPE */
634         gboolean ref_only; /* If kind == ASSEMBLY */
635         char *msg; /* If kind == BAD_IMAGE */
636 } MonoLoaderError;
637
638 #define mono_class_has_parent(klass,parent) (((klass)->idepth >= (parent)->idepth) && ((klass)->supertypes [(parent)->idepth - 1] == (parent)))
639
640 typedef struct {
641         MonoVTable *default_vtable;
642         MonoVTable *xdomain_vtable;
643         MonoClass *proxy_class;
644         char* proxy_class_name;
645         uint32_t interface_count;
646         MonoClass *interfaces [MONO_ZERO_LEN_ARRAY];
647 } MonoRemoteClass;
648
649 #define MONO_SIZEOF_REMOTE_CLASS (sizeof (MonoRemoteClass) - MONO_ZERO_LEN_ARRAY * SIZEOF_VOID_P)
650
651 MonoRemoteClass*
652 mono_remote_class (MonoDomain *domain, MonoString *class_name, MonoClass *proxy_class) MONO_INTERNAL;
653
654 typedef struct {
655         gulong new_object_count;
656         gulong initialized_class_count;
657         gulong generic_vtable_count;
658         gulong used_class_count;
659         gulong method_count;
660         gulong class_vtable_size;
661         gulong class_static_data_size;
662         gulong generic_instance_count;
663         gulong generic_class_count;
664         gulong inflated_method_count;
665         gulong inflated_method_count_2;
666         gulong inflated_type_count;
667         gulong generics_metadata_size;
668         gulong dynamic_code_alloc_count;
669         gulong dynamic_code_bytes_count;
670         gulong dynamic_code_frees_count;
671         gulong delegate_creations;
672         gulong imt_tables_size;
673         gulong imt_number_of_tables;
674         gulong imt_number_of_methods;
675         gulong imt_used_slots;
676         gulong imt_slots_with_collisions;
677         gulong imt_max_collisions_in_slot;
678         gulong imt_method_count_when_max_collisions;
679         gulong imt_thunks_size;
680         gulong jit_info_table_insert_count;
681         gulong jit_info_table_remove_count;
682         gulong jit_info_table_lookup_count;
683         gulong hazardous_pointer_count;
684         gulong generics_sharable_methods;
685         gulong generics_unsharable_methods;
686         gulong generics_shared_methods;
687         gulong minor_gc_count;
688         gulong major_gc_count;
689         gulong minor_gc_time_usecs;
690         gulong major_gc_time_usecs;
691         gboolean enabled;
692 } MonoStats;
693
694 /* 
695  * new structure to hold performace counters values that are exported
696  * to managed code.
697  * Note: never remove fields from this structure and only add them to the end.
698  * Size of fields and type should not be changed as well.
699  */
700 typedef struct {
701         /* JIT category */
702         guint32 jit_methods;
703         guint32 jit_bytes;
704         guint32 jit_time;
705         guint32 jit_failures;
706         /* Exceptions category */
707         guint32 exceptions_thrown;
708         guint32 exceptions_filters;
709         guint32 exceptions_finallys;
710         guint32 exceptions_depth;
711         guint32 aspnet_requests_queued;
712         guint32 aspnet_requests;
713         /* Memory category */
714         guint32 gc_collections0;
715         guint32 gc_collections1;
716         guint32 gc_collections2;
717         guint32 gc_promotions0;
718         guint32 gc_promotions1;
719         guint32 gc_promotion_finalizers;
720         guint32 gc_gen0size;
721         guint32 gc_gen1size;
722         guint32 gc_gen2size;
723         guint32 gc_lossize;
724         guint32 gc_fin_survivors;
725         guint32 gc_num_handles;
726         guint32 gc_allocated;
727         guint32 gc_induced;
728         guint32 gc_time;
729         guint32 gc_total_bytes;
730         guint32 gc_committed_bytes;
731         guint32 gc_reserved_bytes;
732         guint32 gc_num_pinned;
733         guint32 gc_sync_blocks;
734         /* Remoting category */
735         guint32 remoting_calls;
736         guint32 remoting_channels;
737         guint32 remoting_proxies;
738         guint32 remoting_classes;
739         guint32 remoting_objects;
740         guint32 remoting_contexts;
741         /* Loader category */
742         guint32 loader_classes;
743         guint32 loader_total_classes;
744         guint32 loader_appdomains;
745         guint32 loader_total_appdomains;
746         guint32 loader_assemblies;
747         guint32 loader_total_assemblies;
748         guint32 loader_failures;
749         guint32 loader_bytes;
750         guint32 loader_appdomains_uloaded;
751         /* Threads and Locks category  */
752         guint32 thread_contentions;
753         guint32 thread_queue_len;
754         guint32 thread_queue_max;
755         guint32 thread_num_logical;
756         guint32 thread_num_physical;
757         guint32 thread_cur_recognized;
758         guint32 thread_num_recognized;
759         /* Interop category */
760         guint32 interop_num_ccw;
761         guint32 interop_num_stubs;
762         guint32 interop_num_marshals;
763         /* Security category */
764         guint32 security_num_checks;
765         guint32 security_num_link_checks;
766         guint32 security_time;
767         guint32 security_depth;
768         guint32 unused;
769         /* Threadpool */
770         guint64 threadpool_workitems;
771         guint64 threadpool_ioworkitems;
772 } MonoPerfCounters;
773
774 extern MonoPerfCounters *mono_perfcounters MONO_INTERNAL;
775
776 void mono_perfcounters_init (void);
777
778 /*
779  * The definition of the first field in SafeHandle,
780  * Keep in sync with SafeHandle.cs, this is only used
781  * to access the `handle' parameter.
782  */
783 typedef struct {
784         MonoObject  base;
785         void       *handle;
786 } MonoSafeHandle;
787
788 /*
789  * Keep in sync with HandleRef.cs
790  */
791 typedef struct {
792         MonoObject *wrapper;
793         void       *handle;
794 } MonoHandleRef;
795
796 enum {
797         MONO_GENERIC_SHARING_NONE,
798         MONO_GENERIC_SHARING_COLLECTIONS,
799         MONO_GENERIC_SHARING_CORLIB,
800         MONO_GENERIC_SHARING_ALL
801 };
802
803 /*
804  * Flags for which contexts were used in inflating a generic.
805  */
806 enum {
807         MONO_GENERIC_CONTEXT_USED_CLASS = 1,
808         MONO_GENERIC_CONTEXT_USED_METHOD = 2
809 };
810
811 #define MONO_GENERIC_CONTEXT_USED_BOTH          (MONO_GENERIC_CONTEXT_USED_CLASS | MONO_GENERIC_CONTEXT_USED_METHOD)
812
813 extern MonoStats mono_stats MONO_INTERNAL;
814
815 typedef gpointer (*MonoTrampoline)       (MonoMethod *method);
816 typedef gpointer (*MonoJumpTrampoline)       (MonoDomain *domain, MonoMethod *method, gboolean add_sync_wrapper);
817 typedef gpointer (*MonoRemotingTrampoline)       (MonoDomain *domain, MonoMethod *method, MonoRemotingTarget target);
818 typedef gpointer (*MonoDelegateTrampoline)       (MonoClass *klass);
819
820 typedef gpointer (*MonoLookupDynamicToken) (MonoImage *image, guint32 token, gboolean valid_token, MonoClass **handle_class, MonoGenericContext *context);
821
822 typedef gboolean (*MonoGetCachedClassInfo) (MonoClass *klass, MonoCachedClassInfo *res);
823
824 typedef gboolean (*MonoGetClassFromName) (MonoImage *image, const char *name_space, const char *name, MonoClass **res);
825
826 void
827 mono_classes_init (void) MONO_INTERNAL;
828
829 void
830 mono_classes_cleanup (void) MONO_INTERNAL;
831
832 void
833 mono_class_layout_fields   (MonoClass *klass) MONO_INTERNAL;
834
835 void
836 mono_class_setup_interface_offsets (MonoClass *klass) MONO_INTERNAL;
837
838 void
839 mono_class_setup_vtable_general (MonoClass *klass, MonoMethod **overrides, int onum) MONO_INTERNAL;
840
841 void
842 mono_class_setup_vtable (MonoClass *klass) MONO_INTERNAL;
843
844 void
845 mono_class_setup_methods (MonoClass *klass) MONO_INTERNAL;
846
847 void
848 mono_class_setup_mono_type (MonoClass *klass) MONO_INTERNAL;
849
850 void
851 mono_class_setup_parent    (MonoClass *klass, MonoClass *parent) MONO_INTERNAL;
852
853 void
854 mono_class_setup_supertypes (MonoClass *klass) MONO_INTERNAL;
855
856 MonoMethod*
857 mono_class_get_method_by_index (MonoClass *class, int index) MONO_INTERNAL;
858
859 MonoMethod*
860 mono_class_get_inflated_method (MonoClass *class, MonoMethod *method) MONO_INTERNAL;
861
862 MonoMethod*
863 mono_class_get_vtable_entry (MonoClass *class, int offset) MONO_INTERNAL;
864
865 GPtrArray*
866 mono_class_get_implemented_interfaces (MonoClass *klass, MonoError *error) MONO_INTERNAL;
867
868 int
869 mono_class_get_vtable_size (MonoClass *klass) MONO_INTERNAL;
870
871 gboolean
872 mono_class_is_open_constructed_type (MonoType *t) MONO_INTERNAL;
873
874 gboolean
875 mono_class_get_overrides_full (MonoImage *image, guint32 type_token, MonoMethod ***overrides, gint32 *num_overrides,
876                                MonoGenericContext *generic_context) MONO_INTERNAL;
877
878 MonoMethod*
879 mono_class_get_cctor (MonoClass *klass) MONO_INTERNAL;
880
881 MonoMethod*
882 mono_class_get_finalizer (MonoClass *klass) MONO_INTERNAL;
883
884 gboolean
885 mono_class_needs_cctor_run (MonoClass *klass, MonoMethod *caller) MONO_INTERNAL;
886
887 gboolean
888 mono_class_field_is_special_static (MonoClassField *field) MONO_INTERNAL;
889
890 gboolean
891 mono_class_has_special_static_fields (MonoClass *klass) MONO_INTERNAL;
892
893 const char*
894 mono_class_get_field_default_value (MonoClassField *field, MonoTypeEnum *def_type) MONO_INTERNAL;
895
896 const char*
897 mono_class_get_property_default_value (MonoProperty *property, MonoTypeEnum *def_type) MONO_INTERNAL;
898
899 void
900 mono_install_trampoline (MonoTrampoline func) MONO_INTERNAL;
901
902 void
903 mono_install_jump_trampoline (MonoJumpTrampoline func) MONO_INTERNAL;
904
905 void
906 mono_install_remoting_trampoline (MonoRemotingTrampoline func) MONO_INTERNAL;
907
908 void
909 mono_install_delegate_trampoline (MonoDelegateTrampoline func) MONO_INTERNAL;
910
911 gpointer
912 mono_lookup_dynamic_token (MonoImage *image, guint32 token, MonoGenericContext *context) MONO_INTERNAL;
913
914 gpointer
915 mono_lookup_dynamic_token_class (MonoImage *image, guint32 token, gboolean check_token, MonoClass **handle_class, MonoGenericContext *context) MONO_INTERNAL;
916
917 void
918 mono_install_lookup_dynamic_token (MonoLookupDynamicToken func) MONO_INTERNAL;
919
920 gpointer
921 mono_runtime_create_jump_trampoline (MonoDomain *domain, MonoMethod *method, gboolean add_sync_wrapper) MONO_INTERNAL;
922
923 gpointer
924 mono_runtime_create_delegate_trampoline (MonoClass *klass) MONO_INTERNAL;
925
926 void
927 mono_install_get_cached_class_info (MonoGetCachedClassInfo func) MONO_INTERNAL;
928
929 void
930 mono_install_get_class_from_name (MonoGetClassFromName func) MONO_INTERNAL;
931
932 MonoGenericContext*
933 mono_class_get_context (MonoClass *class) MONO_INTERNAL;
934
935 MonoMethodSignature*
936 mono_method_signature_checked (MonoMethod *m, MonoError *err) MONO_INTERNAL;
937
938 MonoGenericContext*
939 mono_method_get_context_general (MonoMethod *method, gboolean uninflated) MONO_INTERNAL;
940
941 MonoGenericContext*
942 mono_method_get_context (MonoMethod *method) MONO_INTERNAL;
943
944 /* Used by monodis, thus cannot be MONO_INTERNAL */
945 MonoGenericContainer*
946 mono_method_get_generic_container (MonoMethod *method);
947
948 MonoGenericContext*
949 mono_generic_class_get_context (MonoGenericClass *gclass) MONO_INTERNAL;
950
951 MonoClass*
952 mono_generic_class_get_class (MonoGenericClass *gclass) MONO_INTERNAL;
953
954 void
955 mono_method_set_generic_container (MonoMethod *method, MonoGenericContainer* container) MONO_INTERNAL;
956
957 MonoMethod*
958 mono_class_inflate_generic_method_full (MonoMethod *method, MonoClass *klass_hint, MonoGenericContext *context) MONO_INTERNAL;
959
960 MonoMethod*
961 mono_class_inflate_generic_method_full_checked (MonoMethod *method, MonoClass *klass_hint, MonoGenericContext *context, MonoError *error) MONO_INTERNAL;
962
963 MonoMethodInflated*
964 mono_method_inflated_lookup (MonoMethodInflated* method, gboolean cache) MONO_INTERNAL;
965
966 MonoMethodSignature *
967 mono_metadata_get_inflated_signature (MonoMethodSignature *sig, MonoGenericContext *context);
968
969 MonoType*
970 mono_class_inflate_generic_type_with_mempool (MonoImage *image, MonoType *type, MonoGenericContext *context, MonoError *error) MONO_INTERNAL;
971
972 MonoClass*
973 mono_class_inflate_generic_class (MonoClass *gklass, MonoGenericContext *context) MONO_INTERNAL;
974
975 MonoType*
976 mono_class_inflate_generic_type_checked (MonoType *type, MonoGenericContext *context, MonoError *error) MONO_INTERNAL;
977
978 void
979 mono_metadata_free_inflated_signature (MonoMethodSignature *sig);
980
981 typedef struct {
982         MonoImage *corlib;
983         MonoClass *object_class;
984         MonoClass *byte_class;
985         MonoClass *void_class;
986         MonoClass *boolean_class;
987         MonoClass *sbyte_class;
988         MonoClass *int16_class;
989         MonoClass *uint16_class;
990         MonoClass *int32_class;
991         MonoClass *uint32_class;
992         MonoClass *int_class;
993         MonoClass *uint_class;
994         MonoClass *int64_class;
995         MonoClass *uint64_class;
996         MonoClass *single_class;
997         MonoClass *double_class;
998         MonoClass *char_class;
999         MonoClass *string_class;
1000         MonoClass *enum_class;
1001         MonoClass *array_class;
1002         MonoClass *delegate_class;
1003         MonoClass *multicastdelegate_class;
1004         MonoClass *asyncresult_class;
1005         MonoClass *manualresetevent_class;
1006         MonoClass *typehandle_class;
1007         MonoClass *fieldhandle_class;
1008         MonoClass *methodhandle_class;
1009         MonoClass *systemtype_class;
1010         MonoClass *monotype_class;
1011         MonoClass *exception_class;
1012         MonoClass *threadabortexception_class;
1013         MonoClass *thread_class;
1014         MonoClass *internal_thread_class;
1015         MonoClass *transparent_proxy_class;
1016         MonoClass *real_proxy_class;
1017         MonoClass *mono_method_message_class;
1018         MonoClass *appdomain_class;
1019         MonoClass *field_info_class;
1020         MonoClass *method_info_class;
1021         MonoClass *stringbuilder_class;
1022         MonoClass *math_class;
1023         MonoClass *stack_frame_class;
1024         MonoClass *stack_trace_class;
1025         MonoClass *marshal_class;
1026         MonoClass *iserializeable_class;
1027         MonoClass *serializationinfo_class;
1028         MonoClass *streamingcontext_class;
1029         MonoClass *typed_reference_class;
1030         MonoClass *argumenthandle_class;
1031         MonoClass *marshalbyrefobject_class;
1032         MonoClass *monitor_class;
1033         MonoClass *iremotingtypeinfo_class;
1034         MonoClass *runtimesecurityframe_class;
1035         MonoClass *executioncontext_class;
1036         MonoClass *internals_visible_class;
1037         MonoClass *generic_ilist_class;
1038         MonoClass *generic_nullable_class;
1039         MonoClass *variant_class;
1040         MonoClass *com_object_class;
1041         MonoClass *com_interop_proxy_class;
1042         MonoClass *iunknown_class;
1043         MonoClass *idispatch_class;
1044         MonoClass *safehandle_class;
1045         MonoClass *handleref_class;
1046         MonoClass *attribute_class;
1047         MonoClass *customattribute_data_class;
1048         MonoClass *critical_finalizer_object;
1049 } MonoDefaults;
1050
1051 extern MonoDefaults mono_defaults MONO_INTERNAL;
1052
1053 void
1054 mono_loader_init           (void) MONO_INTERNAL;
1055
1056 void
1057 mono_loader_cleanup        (void) MONO_INTERNAL;
1058
1059 void
1060 mono_loader_lock           (void) MONO_INTERNAL;
1061
1062 void
1063 mono_loader_unlock         (void) MONO_INTERNAL;
1064
1065 void
1066 mono_loader_lock_track_ownership (gboolean track) MONO_INTERNAL;
1067
1068 gboolean
1069 mono_loader_lock_is_owned_by_self (void) MONO_INTERNAL;
1070
1071 void
1072 mono_loader_set_error_assembly_load (const char *assembly_name, gboolean ref_only) MONO_INTERNAL;
1073
1074 void
1075 mono_loader_set_error_type_load (const char *class_name, const char *assembly_name) MONO_INTERNAL;
1076
1077 void
1078 mono_loader_set_error_method_load (const char *class_name, const char *member_name) MONO_INTERNAL;
1079
1080 void
1081 mono_loader_set_error_field_load (MonoClass *klass, const char *member_name) MONO_INTERNAL;
1082 void
1083 mono_loader_set_error_bad_image (char *msg) MONO_INTERNAL;
1084
1085 MonoException *
1086 mono_loader_error_prepare_exception (MonoLoaderError *error) MONO_INTERNAL;
1087
1088 MonoLoaderError *
1089 mono_loader_get_last_error (void) MONO_INTERNAL;
1090
1091 void
1092 mono_loader_clear_error    (void) MONO_INTERNAL;
1093
1094 void
1095 mono_reflection_init       (void) MONO_INTERNAL;
1096
1097 void
1098 mono_icall_init            (void) MONO_INTERNAL;
1099
1100 void
1101 mono_icall_cleanup         (void) MONO_INTERNAL;
1102
1103 gpointer
1104 mono_method_get_wrapper_data (MonoMethod *method, guint32 id) MONO_INTERNAL;
1105
1106 void
1107 mono_install_stack_walk (MonoStackWalkImpl func) MONO_INTERNAL;
1108
1109 gboolean
1110 mono_metadata_has_generic_params (MonoImage *image, guint32 token) MONO_INTERNAL;
1111
1112 MonoGenericContainer *
1113 mono_metadata_load_generic_params (MonoImage *image, guint32 token,
1114                                    MonoGenericContainer *parent_container);
1115
1116 void
1117 mono_metadata_load_generic_param_constraints (MonoImage *image, guint32 token,
1118                                               MonoGenericContainer *container);
1119
1120 gboolean
1121 mono_metadata_load_generic_param_constraints_full (MonoImage *image, guint32 token,
1122                                               MonoGenericContainer *container) MONO_INTERNAL;
1123
1124 MonoMethodSignature*
1125 mono_create_icall_signature (const char *sigstr) MONO_INTERNAL;
1126
1127 MonoJitICallInfo *
1128 mono_register_jit_icall (gconstpointer func, const char *name, MonoMethodSignature *sig, gboolean is_save) MONO_INTERNAL;
1129
1130 void
1131 mono_register_jit_icall_wrapper (MonoJitICallInfo *info, gconstpointer wrapper) MONO_INTERNAL;
1132
1133 MonoJitICallInfo *
1134 mono_find_jit_icall_by_name (const char *name) MONO_INTERNAL;
1135
1136 MonoJitICallInfo *
1137 mono_find_jit_icall_by_addr (gconstpointer addr) MONO_INTERNAL;
1138
1139 GHashTable*
1140 mono_get_jit_icall_info (void) MONO_INTERNAL;
1141
1142 gboolean
1143 mono_class_set_failure (MonoClass *klass, guint32 ex_type, void *ex_data) MONO_INTERNAL;
1144
1145 gpointer
1146 mono_class_get_exception_data (MonoClass *klass) MONO_INTERNAL;
1147
1148 MonoException*
1149 mono_class_get_exception_for_failure (MonoClass *klass) MONO_INTERNAL;
1150
1151 char*
1152 mono_type_get_name_full (MonoType *type, MonoTypeNameFormat format) MONO_INTERNAL;
1153
1154 char*
1155 mono_type_get_full_name (MonoClass *class) MONO_INTERNAL;
1156
1157 MonoArrayType *mono_dup_array_type (MonoImage *image, MonoArrayType *a) MONO_INTERNAL;
1158 MonoMethodSignature *mono_metadata_signature_deep_dup (MonoImage *image, MonoMethodSignature *sig) MONO_INTERNAL;
1159
1160 void
1161 mono_image_init_name_cache (MonoImage *image);
1162
1163 gboolean mono_class_is_nullable (MonoClass *klass) MONO_INTERNAL;
1164 MonoClass *mono_class_get_nullable_param (MonoClass *klass) MONO_INTERNAL;
1165
1166 /* object debugging functions, for use inside gdb */
1167 void mono_object_describe        (MonoObject *obj);
1168 void mono_object_describe_fields (MonoObject *obj);
1169 void mono_value_describe_fields  (MonoClass* klass, const char* addr);
1170 void mono_class_describe_statics (MonoClass* klass);
1171
1172 /*Enum validation related functions*/
1173 gboolean
1174 mono_type_is_valid_enum_basetype (MonoType * type);
1175
1176 gboolean
1177 mono_class_is_valid_enum (MonoClass *klass);
1178
1179 MonoType *
1180 mono_type_get_full        (MonoImage *image, guint32 type_token, MonoGenericContext *context) MONO_INTERNAL;
1181
1182 gboolean
1183 mono_generic_class_is_generic_type_definition (MonoGenericClass *gklass) MONO_INTERNAL;
1184
1185 MonoMethod*
1186 mono_method_get_declaring_generic_method (MonoMethod *method) MONO_INTERNAL;
1187
1188 MonoMethod*
1189 mono_class_get_method_generic (MonoClass *klass, MonoMethod *method) MONO_INTERNAL;
1190
1191 MonoType*
1192 mono_type_get_basic_type_from_generic (MonoType *type) MONO_INTERNAL;
1193
1194 void
1195 mono_set_generic_sharing_supported (gboolean supported) MONO_INTERNAL;
1196
1197 gboolean
1198 mono_class_generic_sharing_enabled (MonoClass *class) MONO_INTERNAL;
1199
1200 gpointer
1201 mono_class_fill_runtime_generic_context (MonoVTable *class_vtable, guint32 slot) MONO_INTERNAL;
1202
1203 gpointer
1204 mono_method_fill_runtime_generic_context (MonoMethodRuntimeGenericContext *mrgctx, guint32 slot) MONO_INTERNAL;
1205
1206 MonoMethodRuntimeGenericContext*
1207 mono_method_lookup_rgctx (MonoVTable *class_vtable, MonoGenericInst *method_inst) MONO_INTERNAL;
1208
1209 gboolean
1210 mono_method_needs_static_rgctx_invoke (MonoMethod *method, gboolean allow_type_vars) MONO_INTERNAL;
1211
1212 int
1213 mono_class_rgctx_get_array_size (int n, gboolean mrgctx) MONO_INTERNAL;
1214
1215 guint32
1216 mono_method_lookup_or_register_other_info (MonoMethod *method, gboolean in_mrgctx, gpointer data,
1217         int info_type, MonoGenericContext *generic_context) MONO_INTERNAL;
1218
1219 MonoGenericContext
1220 mono_method_construct_object_context (MonoMethod *method) MONO_INTERNAL;
1221
1222 int
1223 mono_generic_context_check_used (MonoGenericContext *context) MONO_INTERNAL;
1224
1225 int
1226 mono_class_check_context_used (MonoClass *class) MONO_INTERNAL;
1227
1228 gboolean
1229 mono_generic_context_is_sharable (MonoGenericContext *context, gboolean allow_type_vars) MONO_INTERNAL;
1230
1231 gboolean
1232 mono_method_is_generic_impl (MonoMethod *method) MONO_INTERNAL;
1233 gboolean
1234 mono_method_is_generic_sharable_impl (MonoMethod *method, gboolean allow_type_vars) MONO_INTERNAL;
1235
1236 void
1237 mono_class_unregister_image_generic_subclasses (MonoImage *image) MONO_INTERNAL;
1238
1239 gboolean
1240 mono_method_can_access_method_full (MonoMethod *method, MonoMethod *called, MonoClass *context_klass) MONO_INTERNAL;
1241
1242 gboolean
1243 mono_method_can_access_field_full (MonoMethod *method, MonoClassField *field, MonoClass *context_klass) MONO_INTERNAL;
1244
1245 MonoClass *
1246 mono_class_get_generic_type_definition (MonoClass *klass) MONO_INTERNAL;
1247
1248 gboolean
1249 mono_class_has_parent_and_ignore_generics (MonoClass *klass, MonoClass *parent) MONO_INTERNAL;
1250
1251 int
1252 mono_method_get_vtable_slot (MonoMethod *method) MONO_INTERNAL;
1253
1254 int
1255 mono_method_get_vtable_index (MonoMethod *method) MONO_INTERNAL;
1256
1257 MonoMethod*
1258 mono_method_search_in_array_class (MonoClass *klass, const char *name, MonoMethodSignature *sig) MONO_INTERNAL;
1259
1260 void
1261 mono_class_setup_interface_id (MonoClass *class) MONO_INTERNAL;
1262
1263 MonoGenericContainer*
1264 mono_class_get_generic_container (MonoClass *klass) MONO_INTERNAL;
1265
1266 MonoGenericClass*
1267 mono_class_get_generic_class (MonoClass *klass) MONO_INTERNAL;
1268
1269 void
1270 mono_class_alloc_ext (MonoClass *klass) MONO_INTERNAL;
1271
1272 void
1273 mono_class_setup_interfaces (MonoClass *klass, MonoError *error) MONO_INTERNAL;
1274
1275 MonoClassField*
1276 mono_class_get_field_from_name_full (MonoClass *klass, const char *name, MonoType *type) MONO_INTERNAL;
1277
1278 MonoVTable*
1279 mono_class_vtable_full (MonoDomain *domain, MonoClass *class, gboolean raise_on_error) MONO_INTERNAL;
1280
1281 gboolean
1282 mono_class_is_assignable_from_slow (MonoClass *target, MonoClass *candidate) MONO_INTERNAL;
1283
1284 gboolean
1285 mono_class_has_variant_generic_params (MonoClass *klass) MONO_INTERNAL;
1286
1287 #endif /* __MONO_METADATA_CLASS_INTERBALS_H__ */