2005-12-23 Dick Porter <dick@ximian.com>
[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         /* add other exception type */
215 };
216
217 /* This struct collects the info needed for the runtime use of a class,
218  * like the vtables for a domain, the GC descriptor, etc.
219  */
220 typedef struct {
221         guint16 max_domain;
222         /* domain_vtables is indexed by the domain id and the size is max_domain + 1 */
223         MonoVTable *domain_vtables [MONO_ZERO_LEN_ARRAY];
224 } MonoClassRuntimeInfo;
225
226 struct _MonoClass {
227         MonoImage *image;
228
229         /* The underlying type of the enum */
230         MonoType *enum_basetype;
231         /* element class for arrays and enum */
232         MonoClass *element_class; 
233         /* used for subtype checks */
234         MonoClass *cast_class; 
235         /* array dimension */
236         guint8     rank;          
237
238         guint inited          : 1;
239         /* We use init_pending to detect cyclic calls to mono_class_init */
240         guint init_pending    : 1;
241
242         /* A class contains static and non static data. Static data can be
243          * of the same type as the class itselfs, but it does not influence
244          * the instance size of the class. To avoid cyclic calls to 
245          * mono_class_init (from mono_class_instance_size ()) we first 
246          * initialise all non static fields. After that we set size_inited 
247          * to 1, because we know the instance size now. After that we 
248          * initialise all static fields.
249          */
250         guint size_inited     : 1;
251         guint valuetype       : 1; /* derives from System.ValueType */
252         guint enumtype        : 1; /* derives from System.Enum */
253         guint blittable       : 1; /* class is blittable */
254         guint unicode         : 1; /* class uses unicode char when marshalled */
255         guint wastypebuilder  : 1; /* class was created at runtime from a TypeBuilder */
256         /* next byte */
257         guint min_align       : 4;
258         guint packing_size    : 4;
259         /* next byte */
260         guint ghcimpl         : 1; /* class has its own GetHashCode impl */ 
261         guint has_finalize    : 1; /* class has its own Finalize impl */ 
262         guint marshalbyref    : 1; /* class is a MarshalByRefObject */
263         guint contextbound    : 1; /* class is a ContextBoundObject */
264         guint delegate        : 1; /* class is a Delegate */
265         guint gc_descr_inited : 1; /* gc_descr is initialized */
266         guint has_cctor       : 1; /* class has a cctor */
267         guint dummy           : 1; /* temporary hack */
268         /* next byte */
269         guint has_references  : 1; /* it has GC-tracked references in the instance */
270         guint has_static_refs : 1; /* it has static fields that are GC-tracked */
271         guint no_special_static_fields : 1; /* has no thread/context static fields */
272
273         guint8     exception_type;      /* MONO_EXCEPTION_* */
274         void*      exception_data;      /* Additional information about the exception */
275         guint32    declsec_flags;       /* declarative security attributes flags */
276
277         MonoClass  *parent;
278         MonoClass  *nested_in;
279         GList      *nested_classes;
280
281         guint32    type_token;
282         const char *name;
283         const char *name_space;
284         
285         /* for fast subtype checks */
286         MonoClass **supertypes;
287         guint16     idepth;
288
289         guint16     interface_count;
290         guint16     interface_id;        /* unique inderface id (for interfaces) */
291         guint16     max_interface_id;
292         gint       *interface_offsets;   
293         MonoClass **interfaces;
294
295         /*
296          * Computed object instance size, total.
297          */
298         int        instance_size;
299         int        class_size;
300         int        vtable_size; /* number of slots */
301
302         /*
303          * From the TypeDef table
304          */
305         guint32    flags;
306         struct {
307                 guint32 first, count;
308         } field, method, property, event;
309
310         /* loaded on demand */
311         MonoMarshalType *marshal_info;
312
313         /*
314          * Field information: Type and location from object base
315          */
316         MonoClassField *fields;
317
318         /* Initialized by a call to mono_class_setup_properties () */
319         MonoProperty *properties;
320
321         /* Initialized by a call to mono_class_setup_events () */
322         MonoEvent *events;
323
324         MonoMethod **methods;
325
326         /* used as the type of the this argument and when passing the arg by value */
327         MonoType this_arg;
328         MonoType byval_arg;
329
330         MonoGenericClass *generic_class;
331         MonoGenericContainer *generic_container;
332
333         void *reflection_info;
334
335         void *gc_descr;
336
337         MonoClassRuntimeInfo *runtime_info;
338
339         /* Generic vtable. Initialized by a call to mono_class_setup_vtable () */
340         MonoMethod **vtable;    
341 };
342
343 struct MonoVTable {
344         MonoClass  *klass;
345     /*
346          * According to comments in gc_gcj.h, this should be the second word in
347          * the vtable.
348          */
349         void *gc_descr;         
350         MonoDomain *domain;  /* each object/vtable belongs to exactly one domain */
351         gpointer   *interface_offsets;   
352         gpointer    data; /* to store static class data */
353         gpointer    type; /* System.Type type for klass */
354         guint16     max_interface_id;
355         guint8      rank;
356         guint remote          : 1; /* class is remotely activated */
357         guint initialized     : 1; /* cctor has been run */
358         /* do not add any fields after vtable, the structure is dynamically extended */
359         gpointer    vtable [MONO_ZERO_LEN_ARRAY];       
360 };
361
362 /*
363  * Generic instantiation data type encoding.
364  */
365
366 /*
367  * A particular generic instantiation:
368  *
369  * All instantiations are cached and we don't distinguish between class and method
370  * instantiations here.
371  */
372 struct _MonoGenericInst {
373         guint id;                       /* unique ID for debugging */
374         guint type_argc    : 22;        /* number of type arguments */
375         guint is_open      :  1;        /* if this is an open type */
376         guint is_reference :  1;        /* if this is a reference type */
377         MonoType **type_argv;
378 };
379
380 /*
381  * A particular instantiation of a generic type.
382  */
383 struct _MonoGenericClass {
384         MonoGenericInst *inst;          /* the instantiation */
385         MonoClass *container_class;     /* the generic type definition */
386         MonoGenericContext *context;    /* current context */
387         guint is_dynamic  : 1;          /* We're a MonoDynamicGenericClass */
388         guint is_inflated : 1;          /* We're a MonoInflatedGenericClass */
389 };
390
391 /*
392  * Performance optimization:
393  * We don't create the `MonoClass' for a `MonoGenericClass' until we really
394  * need it.
395  */
396 struct _MonoInflatedGenericClass {
397         MonoGenericClass generic_class;
398         guint is_initialized   : 1;
399         MonoClass *klass;
400 };
401
402 /*
403  * This is used when instantiating a generic type definition which is
404  * a TypeBuilder.
405  */
406 struct _MonoDynamicGenericClass {
407         MonoInflatedGenericClass generic_class;
408         MonoType *parent;
409         int count_ifaces;
410         MonoType **ifaces;
411         int count_methods;
412         MonoMethod **methods;
413         int count_ctors;
414         MonoMethod **ctors;
415         int count_fields;
416         MonoClassField *fields;
417         int count_properties;
418         MonoProperty *properties;
419         int count_events;
420         MonoEvent *events;
421         guint initialized;
422 };
423
424 /*
425  * A particular instantiation of a generic method.
426  */
427 struct _MonoGenericMethod {
428         MonoGenericInst *inst;                  /* the instantiation */
429         MonoGenericClass *generic_class;        /* if we're in a generic type */
430         MonoGenericContainer *container;        /* type parameters */
431         gpointer reflection_info;
432 };
433
434 /*
435  * The generic context.
436  */
437 struct _MonoGenericContext {
438         /*
439          * The current container:
440          *
441          * If we're in a generic method, the generic method definition's container.
442          * Otherwise the generic type's container.
443          */
444         MonoGenericContainer *container;
445         /* The current generic class */
446         MonoGenericClass *gclass;
447         /* The current generic method */
448         MonoGenericMethod *gmethod;
449 };
450
451 /*
452  * The generic container.
453  *
454  * Stores the type parameters of a generic type definition or a generic method definition.
455  */
456 struct _MonoGenericContainer {
457         MonoGenericContext context;
458         /* If we're a generic method definition, the containing class'es context. */
459         MonoGenericContainer *parent;
460         /* If we're a generic method definition, caches all their instantiations. */
461         GHashTable *method_hash;
462         /* If we're a generic type definition, its `MonoClass'. */
463         MonoClass *klass;
464         int type_argc    : 6;
465         /* If true, we're a generic method, otherwise a generic type definition. */
466         int is_method    : 1;
467         /* Our type parameters. */
468         MonoGenericParam *type_params;
469         /* Cache for MonoTypes */
470         MonoType **types;
471 };
472
473 /*
474  * A type parameter.
475  */
476 struct _MonoGenericParam {
477         MonoGenericContainer *owner;    /* Type or method this parameter was defined in. */
478         MonoClass *pklass;              /* The corresponding `MonoClass'. */
479         MonoMethod *method;             /* If we're a method type parameter, the method. */
480         const char *name;
481         guint16 flags;
482         guint16 num;
483         MonoClass** constraints; /* NULL means end of list */
484 };
485
486 /*
487  * Class information which might be cached by the runtime in the AOT file for
488  * example. Caching this allows us to avoid computing a generic vtable
489  * (class->vtable) in most cases, saving time and avoiding creation of lots of
490  * MonoMethod structures.
491  */
492 typedef struct MonoCachedClassInfo {
493         guint32 vtable_size;
494         guint has_finalize : 1;
495         guint ghcimpl : 1;
496         guint has_cctor : 1;
497         guint has_nested_classes : 1;
498         guint blittable : 1;
499         guint has_references : 1;
500         guint has_static_refs : 1;
501         guint no_special_static_fields : 1;
502         guint32 cctor_token;
503         MonoImage *finalize_image;
504         guint32 finalize_token;
505         guint32 instance_size;
506         guint32 class_size;
507         guint32 packing_size;
508         guint32 min_align;
509 } MonoCachedClassInfo;
510
511 typedef struct {
512         const char *name;
513         gconstpointer func;
514         gconstpointer wrapper;
515         MonoMethodSignature *sig;
516 } MonoJitICallInfo;
517
518 /*
519  * Information about a type load error encountered by the loader.
520  */
521 typedef enum {
522         MONO_LOADER_ERROR_TYPE,
523         MONO_LOADER_ERROR_METHOD,
524         MONO_LOADER_ERROR_FIELD
525 } MonoLoaderErrorKind;
526
527 typedef struct {
528         MonoLoaderErrorKind kind;
529         char *class_name, *assembly_name; /* If kind == TYPE */
530         MonoClass *klass; /* If kind != TYPE */
531         const char *member_name; /* If kind != TYPE */
532 } MonoLoaderError;
533
534 #define mono_class_has_parent(klass,parent) (((klass)->idepth >= (parent)->idepth) && ((klass)->supertypes [(parent)->idepth - 1] == (parent)))
535
536 typedef struct {
537         gulong new_object_count;
538         gulong initialized_class_count;
539         gulong used_class_count;
540         gulong class_vtable_size;
541         gulong class_static_data_size;
542         gulong generic_instance_count;
543         gulong generic_class_count;
544         gulong inflated_method_count;
545         gulong inflated_method_count_2;
546         gulong inflated_type_count;
547         gulong generics_metadata_size;
548         gboolean enabled;
549 } MonoStats;
550
551 extern MonoStats mono_stats;
552
553 typedef gpointer (*MonoTrampoline)       (MonoMethod *method);
554 typedef gpointer (*MonoRemotingTrampoline)       (MonoMethod *method, MonoRemotingTarget target);
555 typedef gpointer (*MonoDelegateTrampoline)       (MonoMethod *method, gpointer addr);
556
557 typedef gpointer (*MonoLookupDynamicToken) (MonoImage *image, guint32 token, MonoClass **handle_class);
558
559 typedef gboolean (*MonoGetCachedClassInfo) (MonoClass *klass, MonoCachedClassInfo *res);
560
561 void
562 mono_classes_init (void);
563
564 void
565 mono_class_layout_fields   (MonoClass *klass);
566
567 void
568 mono_class_setup_vtable_general (MonoClass *klass, MonoMethod **overrides, int onum);
569
570 void
571 mono_class_setup_vtable (MonoClass *klass);
572
573 void
574 mono_class_setup_methods (MonoClass *klass);
575
576 void
577 mono_class_setup_mono_type (MonoClass *klass);
578
579 void
580 mono_class_setup_parent    (MonoClass *klass, MonoClass *parent);
581
582 void
583 mono_class_setup_supertypes (MonoClass *klass);
584
585 GPtrArray*
586 mono_class_get_implemented_interfaces (MonoClass *klass);
587
588 gboolean
589 mono_class_is_open_constructed_type (MonoType *t);
590
591 gboolean
592 mono_class_get_overrides_full (MonoImage *image, guint32 type_token, MonoMethod ***overrides, gint32 *num_overrides,
593                                MonoGenericContext *generic_context);
594
595 MonoMethod*
596 mono_class_get_cctor (MonoClass *klass);
597
598 MonoMethod*
599 mono_class_get_finalizer (MonoClass *klass);
600
601 gboolean
602 mono_class_needs_cctor_run (MonoClass *klass, MonoMethod *caller);
603
604 gboolean
605 mono_class_has_special_static_fields (MonoClass *klass);
606
607 void
608 mono_install_trampoline (MonoTrampoline func);
609
610 void
611 mono_install_remoting_trampoline (MonoRemotingTrampoline func);
612
613 void
614 mono_install_delegate_trampoline (MonoDelegateTrampoline func);
615
616 gpointer
617 mono_lookup_dynamic_token (MonoImage *image, guint32 token);
618
619 gpointer
620 mono_lookup_dynamic_token_class (MonoImage *image, guint32 token, MonoClass **handle_class);
621
622 void
623 mono_install_lookup_dynamic_token (MonoLookupDynamicToken func);
624
625 void
626 mono_install_get_cached_class_info (MonoGetCachedClassInfo func);
627
628 MonoInflatedGenericClass*
629 mono_get_inflated_generic_class (MonoGenericClass *gclass);
630
631 typedef struct {
632         MonoImage *corlib;
633         MonoClass *object_class;
634         MonoClass *byte_class;
635         MonoClass *void_class;
636         MonoClass *boolean_class;
637         MonoClass *sbyte_class;
638         MonoClass *int16_class;
639         MonoClass *uint16_class;
640         MonoClass *int32_class;
641         MonoClass *uint32_class;
642         MonoClass *int_class;
643         MonoClass *uint_class;
644         MonoClass *int64_class;
645         MonoClass *uint64_class;
646         MonoClass *single_class;
647         MonoClass *double_class;
648         MonoClass *char_class;
649         MonoClass *string_class;
650         MonoClass *enum_class;
651         MonoClass *array_class;
652         MonoClass *delegate_class;
653         MonoClass *multicastdelegate_class;
654         MonoClass *asyncresult_class;
655         MonoClass *waithandle_class;
656         MonoClass *typehandle_class;
657         MonoClass *fieldhandle_class;
658         MonoClass *methodhandle_class;
659         MonoClass *monotype_class;
660         MonoClass *exception_class;
661         MonoClass *threadabortexception_class;
662         MonoClass *thread_class;
663         MonoClass *transparent_proxy_class;
664         MonoClass *real_proxy_class;
665         MonoClass *mono_method_message_class;
666         MonoClass *appdomain_class;
667         MonoClass *field_info_class;
668         MonoClass *method_info_class;
669         MonoClass *stringbuilder_class;
670         MonoClass *math_class;
671         MonoClass *stack_frame_class;
672         MonoClass *stack_trace_class;
673         MonoClass *marshal_class;
674         MonoClass *iserializeable_class;
675         MonoClass *serializationinfo_class;
676         MonoClass *streamingcontext_class;
677         MonoClass *typed_reference_class;
678         MonoClass *argumenthandle_class;
679         MonoClass *marshalbyrefobject_class;
680         MonoClass *monitor_class;
681         MonoClass *iremotingtypeinfo_class;
682         MonoClass *runtimesecurityframe_class;
683         MonoClass *executioncontext_class;
684         MonoClass *generic_array_class;
685         MonoClass *generic_nullable_class;
686 } MonoDefaults;
687
688 extern MonoDefaults mono_defaults;
689
690 void
691 mono_loader_init           (void);
692
693 void
694 mono_loader_lock           (void);
695
696 void
697 mono_loader_unlock         (void);
698
699 void
700 mono_loader_set_error_type_load (char *class_name, char *assembly_name);
701
702 void
703 mono_loader_set_error_method_load (MonoClass *klass, const char *member_name);
704
705 void
706 mono_loader_set_error_field_load (MonoClass *klass, const char *member_name);
707
708 MonoLoaderError*
709 mono_loader_get_last_error (void);
710
711 void
712 mono_loader_clear_error    (void);
713
714 void 
715 mono_icall_init            (void);
716
717 void
718 mono_icall_cleanup         (void);
719
720 gpointer
721 mono_method_get_wrapper_data (MonoMethod *method, guint32 id);
722
723 void
724 mono_install_stack_walk (MonoStackWalkImpl func);
725
726 gboolean
727 mono_metadata_has_generic_params (MonoImage *image, guint32 token);
728
729 MonoGenericContainer *
730 mono_metadata_load_generic_params (MonoImage *image, guint32 token,
731                                    MonoGenericContainer *parent_container);
732
733 void
734 mono_metadata_load_generic_param_constraints (MonoImage *image, guint32 token,
735                                               MonoGenericContainer *container);
736
737 MonoMethodSignature*
738 mono_create_icall_signature (const char *sigstr);
739
740 MonoJitICallInfo *
741 mono_register_jit_icall (gconstpointer func, const char *name, MonoMethodSignature *sig, gboolean is_save);
742
743 void
744 mono_register_jit_icall_wrapper (MonoJitICallInfo *info, gconstpointer wrapper);
745
746 MonoJitICallInfo *
747 mono_find_jit_icall_by_name (const char *name);
748
749 MonoJitICallInfo *
750 mono_find_jit_icall_by_addr (gconstpointer addr);
751
752 MonoMethodSignature*
753 mono_class_inflate_generic_signature (MonoImage *image, MonoMethodSignature *sig, MonoGenericContext *context);
754
755 MonoMethodSignature *
756 mono_method_signature_full (MonoMethod *image, MonoGenericContainer *container);
757
758 MonoGenericClass *
759 mono_get_shared_generic_class (MonoGenericContainer *container, gboolean is_dynamic);
760
761 gboolean
762 mono_class_set_failure (MonoClass *klass, guint32 ex_type, void *ex_data);
763
764 MonoException*
765 mono_class_get_exception_for_failure (MonoClass *klass);
766
767 char*
768 mono_type_get_name_full (MonoType *type, MonoTypeNameFormat format);
769
770 char*
771 mono_type_get_full_name (MonoClass *class);
772
773 MonoArrayType *mono_dup_array_type (MonoArrayType *a);
774 MonoMethodSignature *mono_metadata_signature_deep_dup (MonoMethodSignature *sig);
775
776 gboolean mono_class_is_nullable (MonoClass *klass);
777 MonoClass *mono_class_get_nullable_param (MonoClass *klass);
778
779 #endif /* __MONO_METADATA_CLASS_INTERBALS_H__ */
780