1 #ifndef __MONO_METADATA_CLASS_INTERBALS_H__
2 #define __MONO_METADATA_CLASS_INTERBALS_H__
4 #include <mono/metadata/class.h>
5 #include <mono/metadata/object.h>
6 #include <mono/metadata/mempool.h>
7 #include <mono/io-layer/io-layer.h>
8 #include "mono/utils/mono-compiler.h"
10 #define MONO_CLASS_IS_ARRAY(c) ((c)->rank)
12 #define MONO_CLASS_HAS_STATIC_METADATA(klass) ((klass)->type_token && !(klass)->image->dynamic && !(klass)->generic_class)
14 #define MONO_DEFAULT_SUPERTABLE_SIZE 6
16 extern gboolean mono_print_vtable;
18 extern gboolean mono_setup_vtable_in_class_init;
20 typedef void (*MonoStackWalkImpl) (MonoStackWalk func, gboolean do_il_offset, gpointer user_data);
22 typedef struct _MonoMethodNormal MonoMethodNormal;
23 typedef struct _MonoMethodWrapper MonoMethodWrapper;
24 typedef struct _MonoMethodInflated MonoMethodInflated;
25 typedef struct _MonoMethodPInvoke MonoMethodPInvoke;
27 /* Properties that applies to a group of structs should better use a higher number
28 * to avoid colision with type specific properties.
30 * This prop applies to class, method, property, event, assembly and image.
32 #define MONO_PROP_DYNAMIC_CATTR 0x1000
35 #define WRAPPER(e,n) MONO_WRAPPER_ ## e,
36 #include "wrapper-types.h"
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
49 MONO_REMOTING_TARGET_UNKNOWN,
50 MONO_REMOTING_TARGET_APPDOMAIN,
51 MONO_REMOTING_TARGET_COMINTEROP
54 #define MONO_METHOD_PROP_GENERIC_CONTAINER 0
57 guint16 flags; /* method flags */
58 guint16 iflags; /* method implementation flags */
61 MonoMethodSignature *signature;
62 /* name is useful mostly for debugging */
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 */
80 * If is_generic is TRUE, the generic_container is stored in image->property_hash,
81 * using the key MONO_METHOD_PROP_GENERIC_CONTAINER.
85 struct _MonoMethodNormal {
87 MonoMethodHeader *header;
90 struct _MonoMethodWrapper {
91 MonoMethodNormal method;
95 struct _MonoMethodPInvoke {
98 /* add marshal info */
99 guint16 piflags; /* pinvoke flags */
100 guint16 implmap_idx; /* index into IMPLMAP */
104 * Stores the default value / RVA of fields.
105 * This information is rarely needed, so it is stored separately from MonoClassField.
107 typedef struct MonoFieldDefaultValue {
109 * If the field is constant, pointer to the metadata constant
111 * If the field has an RVA flag, pointer to the data.
116 /* If the field is constant, the type of the constant. */
117 MonoTypeEnum def_type;
118 } MonoFieldDefaultValue;
121 * MonoClassField is just a runtime representation of the metadata for
122 * field, it doesn't contain the data directly. Static fields are
123 * stored in MonoVTable->data. Instance fields are allocated in the
124 * objects after the object header.
126 struct _MonoClassField {
127 /* Type of the field */
132 /* Type where the field was defined */
136 * Offset where this field is stored; if it is an instance
137 * field, it's the offset from the start of the object, if
138 * it's static, it's from the start of the memory chunk
139 * allocated for statics for the class.
144 /* a field is ignored if it's named "_Deleted" and it has the specialname and rtspecialname flags set */
145 #define mono_field_is_deleted(field) (((field)->type->attrs & (FIELD_ATTRIBUTE_SPECIAL_NAME | FIELD_ATTRIBUTE_RT_SPECIAL_NAME)) \
146 && (strcmp (mono_field_get_name (field), "_Deleted") == 0))
149 MonoClassField *field;
151 MonoMarshalSpec *mspec;
155 guint32 native_size, min_align;
157 MonoMethod *ptr_to_str;
158 MonoMethod *str_to_ptr;
159 MonoMarshalField fields [MONO_ZERO_LEN_ARRAY];
162 struct _MonoProperty {
180 /* type of exception being "on hold" for later processing (see exception_type) */
182 MONO_EXCEPTION_NONE = 0,
183 MONO_EXCEPTION_SECURITY_LINKDEMAND = 1,
184 MONO_EXCEPTION_SECURITY_INHERITANCEDEMAND = 2,
185 MONO_EXCEPTION_INVALID_PROGRAM = 3,
186 MONO_EXCEPTION_UNVERIFIABLE_IL = 4,
187 MONO_EXCEPTION_MISSING_METHOD = 5,
188 MONO_EXCEPTION_MISSING_FIELD = 6,
189 MONO_EXCEPTION_TYPE_LOAD = 7,
190 MONO_EXCEPTION_FILE_NOT_FOUND = 8,
191 MONO_EXCEPTION_METHOD_ACCESS = 9,
192 MONO_EXCEPTION_FIELD_ACCESS = 10,
193 MONO_EXCEPTION_GENERIC_SHARING_FAILED = 11,
194 MONO_EXCEPTION_BAD_IMAGE = 12,
195 MONO_EXCEPTION_OBJECT_SUPPLIED = 13 /*The exception object is already created.*/
196 /* add other exception type */
199 /* This struct collects the info needed for the runtime use of a class,
200 * like the vtables for a domain, the GC descriptor, etc.
204 /* domain_vtables is indexed by the domain id and the size is max_domain + 1 */
205 MonoVTable *domain_vtables [MONO_ZERO_LEN_ARRAY];
206 } MonoClassRuntimeInfo;
209 MONO_RGCTX_INFO_STATIC_DATA,
210 MONO_RGCTX_INFO_KLASS,
211 MONO_RGCTX_INFO_VTABLE,
212 MONO_RGCTX_INFO_TYPE,
213 MONO_RGCTX_INFO_REFLECTION_TYPE,
214 MONO_RGCTX_INFO_METHOD,
215 MONO_RGCTX_INFO_GENERIC_METHOD_CODE,
216 MONO_RGCTX_INFO_CLASS_FIELD,
217 MONO_RGCTX_INFO_METHOD_RGCTX,
218 MONO_RGCTX_INFO_METHOD_CONTEXT
221 typedef struct _MonoRuntimeGenericContextOtherInfoTemplate {
224 struct _MonoRuntimeGenericContextOtherInfoTemplate *next;
225 } MonoRuntimeGenericContextOtherInfoTemplate;
228 MonoClass *next_subclass;
229 MonoRuntimeGenericContextOtherInfoTemplate *other_infos;
230 GSList *method_templates;
231 } MonoRuntimeGenericContextTemplate;
234 MonoVTable *class_vtable; /* must be the first element */
235 MonoGenericInst *method_inst;
236 gpointer infos [MONO_ZERO_LEN_ARRAY];
237 } MonoMethodRuntimeGenericContext;
239 #define MONO_RGCTX_SLOT_MAKE_RGCTX(i) (i)
240 #define MONO_RGCTX_SLOT_MAKE_MRGCTX(i) ((i) | 0x80000000)
241 #define MONO_RGCTX_SLOT_INDEX(s) ((s) & 0x7fffffff)
242 #define MONO_RGCTX_SLOT_IS_MRGCTX(s) (((s) & 0x80000000) ? TRUE : FALSE)
245 #define MONO_CLASS_PROP_EXCEPTION_DATA 0
248 * This structure contains the rarely used fields of MonoClass
249 * Since using just one field causes the whole structure to be allocated, it should
250 * be used for fields which are only used in like 5% of all classes.
254 guint32 first, count;
257 /* Initialized by a call to mono_class_setup_properties () */
258 MonoProperty *properties;
260 /* Initialized by a call to mono_class_setup_events () */
263 guint32 declsec_flags; /* declarative security attributes flags */
265 /* Default values/RVA for fields */
266 /* Accessed using mono_class_get_field_default_value () / mono_field_get_data () */
267 MonoFieldDefaultValue *field_def_values;
269 GList *nested_classes;
273 /* element class for arrays and enum basetype for enums */
274 MonoClass *element_class;
275 /* used for subtype checks */
276 MonoClass *cast_class;
278 /* for fast subtype checks */
279 MonoClass **supertypes;
282 /* array dimension */
285 int instance_size; /* object instance size */
288 /* We use init_pending to detect cyclic calls to mono_class_init */
289 guint init_pending : 1;
291 /* A class contains static and non static data. Static data can be
292 * of the same type as the class itselfs, but it does not influence
293 * the instance size of the class. To avoid cyclic calls to
294 * mono_class_init (from mono_class_instance_size ()) we first
295 * initialise all non static fields. After that we set size_inited
296 * to 1, because we know the instance size now. After that we
297 * initialise all static fields.
299 guint size_inited : 1;
300 guint valuetype : 1; /* derives from System.ValueType */
301 guint enumtype : 1; /* derives from System.Enum */
302 guint blittable : 1; /* class is blittable */
303 guint unicode : 1; /* class uses unicode char when marshalled */
304 guint wastypebuilder : 1; /* class was created at runtime from a TypeBuilder */
308 guint packing_size : 4;
309 /* still 4 bits free */
311 guint ghcimpl : 1; /* class has its own GetHashCode impl */
312 guint has_finalize : 1; /* class has its own Finalize impl */
313 guint marshalbyref : 1; /* class is a MarshalByRefObject */
314 guint contextbound : 1; /* class is a ContextBoundObject */
315 guint delegate : 1; /* class is a Delegate */
316 guint gc_descr_inited : 1; /* gc_descr is initialized */
317 guint has_cctor : 1; /* class has a cctor */
318 guint has_references : 1; /* it has GC-tracked references in the instance */
320 guint has_static_refs : 1; /* it has static fields that are GC-tracked */
321 guint no_special_static_fields : 1; /* has no thread/context static fields */
322 /* directly or indirectly derives from ComImport attributed class.
323 * this means we need to create a proxy for instances of this class
324 * for COM Interop. set this flag on loading so all we need is a quick check
325 * during object creation rather than having to traverse supertypes
327 guint is_com_object : 1;
328 guint nested_classes_inited : 1; /* Whenever nested_class is initialized */
329 guint interfaces_inited : 1; /* interfaces is initialized */
330 guint simd_type : 1; /* class is a simd intrinsic type */
331 guint is_generic : 1; /* class is a generic type definition */
332 guint is_inflated : 1; /* class is a generic instance */
334 guint8 exception_type; /* MONO_EXCEPTION_* */
336 /* Additional information about the exception */
337 /* Stored as property MONO_CLASS_PROP_EXCEPTION_DATA */
338 //void *exception_data;
341 MonoClass *nested_in;
345 const char *name_space;
348 int vtable_size; /* number of slots */
350 guint16 interface_count;
351 guint16 interface_id; /* unique inderface id (for interfaces) */
352 guint16 max_interface_id;
354 guint16 interface_offsets_count;
355 MonoClass **interfaces_packed;
356 guint16 *interface_offsets_packed;
357 guint8 *interface_bitmap;
359 MonoClass **interfaces;
362 int class_size; /* size of area for static fields */
363 int element_size; /* for array types */
364 int generic_param_token; /* for generic param types, both var and mvar */
368 * From the TypeDef table
372 guint32 first, count;
375 /* loaded on demand */
376 MonoMarshalType *marshal_info;
379 * Field information: Type and location from object base
381 MonoClassField *fields;
383 MonoMethod **methods;
385 /* used as the type of the this argument and when passing the arg by value */
389 MonoGenericClass *generic_class;
390 MonoGenericContainer *generic_container;
392 void *reflection_info;
396 MonoClassRuntimeInfo *runtime_info;
398 /* next element in the class_cache hash list (in MonoImage) */
399 MonoClass *next_class_cache;
401 /* Generic vtable. Initialized by a call to mono_class_setup_vtable () */
404 /* Rarely used fields of classes */
408 #define MONO_CLASS_IMPLEMENTS_INTERFACE(k,uiid) (((uiid) <= (k)->max_interface_id) && ((k)->interface_bitmap [(uiid) >> 3] & (1 << ((uiid)&7))))
409 int mono_class_interface_offset (MonoClass *klass, MonoClass *itf);
411 typedef gpointer MonoRuntimeGenericContext;
413 /* the interface_offsets array is stored in memory before this struct */
417 * According to comments in gc_gcj.h, this should be the second word in
421 MonoDomain *domain; /* each object/vtable belongs to exactly one domain */
422 gpointer data; /* to store static class data */
423 gpointer type; /* System.Type type for klass */
424 guint8 *interface_bitmap;
425 guint16 max_interface_id;
427 guint remote : 1; /* class is remotely activated */
428 guint initialized : 1; /* cctor has been run */
429 guint init_failed : 1; /* cctor execution failed */
430 guint32 imt_collisions_bitmap;
431 MonoRuntimeGenericContext *runtime_generic_context;
432 /* do not add any fields after vtable, the structure is dynamically extended */
433 gpointer vtable [MONO_ZERO_LEN_ARRAY];
436 #define MONO_VTABLE_IMPLEMENTS_INTERFACE(vt,uiid) (((uiid) <= (vt)->max_interface_id) && ((vt)->interface_bitmap [(uiid) >> 3] & (1 << ((uiid)&7))))
439 * Generic instantiation data type encoding.
443 * A particular generic instantiation:
445 * All instantiations are cached and we don't distinguish between class and method
446 * instantiations here.
448 struct _MonoGenericInst {
449 guint id; /* unique ID for debugging */
450 guint type_argc : 22; /* number of type arguments */
451 guint is_open : 1; /* if this is an open type */
452 MonoType *type_argv [MONO_ZERO_LEN_ARRAY];
456 * The generic context: an instantiation of a set of class and method generic parameters.
458 * NOTE: Never allocate this directly on the heap. It have to be either allocated on the stack,
459 * or embedded within other objects. Don't store pointers to this, because it may be on the stack.
460 * If you really have to, ensure you store a pointer to the embedding object along with it.
462 struct _MonoGenericContext {
463 /* The instantiation corresponding to the class generic parameters */
464 MonoGenericInst *class_inst;
465 /* The instantiation corresponding to the method generic parameters */
466 MonoGenericInst *method_inst;
470 * Inflated generic method.
472 struct _MonoMethodInflated {
475 MonoMethodNormal normal;
476 MonoMethodPInvoke pinvoke;
478 MonoMethod *declaring; /* the generic method definition. */
479 MonoGenericContext context; /* The current instantiation */
483 * A particular instantiation of a generic type.
485 struct _MonoGenericClass {
486 MonoClass *container_class; /* the generic type definition */
487 MonoGenericContext context; /* a context that contains the type instantiation doesn't contain any method instantiation */
488 guint is_dynamic : 1; /* We're a MonoDynamicGenericClass */
489 guint is_tb_open : 1; /* This is the fully open instantiation for a type_builder. Quite ugly, but it's temporary.*/
490 MonoClass *cached_class; /* if present, the MonoClass corresponding to the instantiation. */
494 * This is used when instantiating a generic type definition which is
497 struct _MonoDynamicGenericClass {
498 MonoGenericClass generic_class;
500 MonoMethod **methods;
504 MonoClassField *fields;
505 int count_properties;
506 MonoProperty *properties;
510 /* The non-inflated types of the fields */
511 MonoType **field_generic_types;
512 /* The managed objects representing the fields */
513 MonoObject **field_objects;
517 * The generic container.
519 * Stores the type parameters of a generic type definition or a generic method definition.
521 struct _MonoGenericContainer {
522 MonoGenericContext context;
523 /* If we're a generic method definition in a generic type definition,
524 the generic container of the containing class. */
525 MonoGenericContainer *parent;
526 /* the generic type definition or the generic method definition corresponding to this container */
532 /* If true, we're a generic method, otherwise a generic type definition. */
533 /* Invariant: parent != NULL => is_method */
535 /* Our type parameters. */
536 MonoGenericParam *type_params;
539 #define mono_generic_container_get_param(gc, i) ((gc)->type_params + (i))
540 #define mono_generic_container_get_param_info(gc, i) (mono_generic_param_info ((gc)->type_params + (i)))
542 /* Additional details about a MonoGenericParam */
544 MonoClass *pklass; /* The corresponding `MonoClass'. */
547 MonoClass** constraints; /* NULL means end of list */
548 } MonoGenericParamInfo;
553 struct _MonoGenericParam {
554 MonoGenericContainer *owner; /* Type or method this parameter was defined in. */
556 /* If owner is NULL, this is the image whose mempool this struct was allocated from */
559 MonoGenericParamInfo info;
562 #define mono_generic_param_owner(p) ((p)->owner)
563 #define mono_generic_param_num(p) ((p)->num)
564 #define mono_generic_param_info(p) (&(p)->info)
565 #define mono_type_get_generic_param_owner(t) (mono_generic_param_owner ((t)->data.generic_param))
566 #define mono_type_get_generic_param_num(t) (mono_generic_param_num ((t)->data.generic_param))
569 * Class information which might be cached by the runtime in the AOT file for
570 * example. Caching this allows us to avoid computing a generic vtable
571 * (class->vtable) in most cases, saving time and avoiding creation of lots of
572 * MonoMethod structures.
574 typedef struct MonoCachedClassInfo {
576 guint has_finalize : 1;
579 guint has_nested_classes : 1;
581 guint has_references : 1;
582 guint has_static_refs : 1;
583 guint no_special_static_fields : 1;
585 MonoImage *finalize_image;
586 guint32 finalize_token;
587 guint32 instance_size;
589 guint32 packing_size;
591 } MonoCachedClassInfo;
596 gconstpointer wrapper;
597 gconstpointer trampoline;
598 MonoMethodSignature *sig;
602 guint8 exception_type;
603 char *class_name; /* If kind == TYPE */
604 char *assembly_name; /* If kind == TYPE or ASSEMBLY */
605 MonoClass *klass; /* If kind != TYPE */
606 const char *member_name; /* If kind != TYPE */
607 gboolean ref_only; /* If kind == ASSEMBLY */
608 char *msg; /* If kind == BAD_IMAGE */
611 #define mono_class_has_parent(klass,parent) (((klass)->idepth >= (parent)->idepth) && ((klass)->supertypes [(parent)->idepth - 1] == (parent)))
614 gulong new_object_count;
615 gulong initialized_class_count;
616 gulong generic_vtable_count;
617 gulong used_class_count;
619 gulong class_vtable_size;
620 gulong class_static_data_size;
621 gulong generic_instance_count;
622 gulong generic_class_count;
623 gulong inflated_method_count;
624 gulong inflated_method_count_2;
625 gulong inflated_type_count;
626 gulong generics_metadata_size;
627 gulong dynamic_code_alloc_count;
628 gulong dynamic_code_bytes_count;
629 gulong dynamic_code_frees_count;
630 gulong delegate_creations;
631 gulong imt_tables_size;
632 gulong imt_number_of_tables;
633 gulong imt_number_of_methods;
634 gulong imt_used_slots;
635 gulong imt_slots_with_collisions;
636 gulong imt_max_collisions_in_slot;
637 gulong imt_method_count_when_max_collisions;
638 gulong imt_thunks_size;
639 gulong jit_info_table_insert_count;
640 gulong jit_info_table_remove_count;
641 gulong jit_info_table_lookup_count;
642 gulong hazardous_pointer_count;
643 gulong generics_sharable_methods;
644 gulong generics_unsharable_methods;
645 gulong generics_shared_methods;
646 gulong minor_gc_count;
647 gulong major_gc_count;
648 gulong minor_gc_time_usecs;
649 gulong major_gc_time_usecs;
654 * new structure to hold performace counters values that are exported
656 * Note: never remove fields from this structure and only add them to the end.
657 * Size of fields and type should not be changed as well.
664 guint32 jit_failures;
665 /* Exceptions category */
666 guint32 exceptions_thrown;
667 guint32 exceptions_filters;
668 guint32 exceptions_finallys;
669 guint32 exceptions_depth;
670 guint32 aspnet_requests_queued;
671 guint32 aspnet_requests;
672 /* Memory category */
673 guint32 gc_collections0;
674 guint32 gc_collections1;
675 guint32 gc_collections2;
676 guint32 gc_promotions0;
677 guint32 gc_promotions1;
678 guint32 gc_promotion_finalizers;
683 guint32 gc_fin_survivors;
684 guint32 gc_num_handles;
685 guint32 gc_allocated;
688 guint32 gc_total_bytes;
689 guint32 gc_committed_bytes;
690 guint32 gc_reserved_bytes;
691 guint32 gc_num_pinned;
692 guint32 gc_sync_blocks;
693 /* Remoting category */
694 guint32 remoting_calls;
695 guint32 remoting_channels;
696 guint32 remoting_proxies;
697 guint32 remoting_classes;
698 guint32 remoting_objects;
699 guint32 remoting_contexts;
700 /* Loader category */
701 guint32 loader_classes;
702 guint32 loader_total_classes;
703 guint32 loader_appdomains;
704 guint32 loader_total_appdomains;
705 guint32 loader_assemblies;
706 guint32 loader_total_assemblies;
707 guint32 loader_failures;
708 guint32 loader_bytes;
709 guint32 loader_appdomains_uloaded;
710 /* Threads and Locks category */
711 guint32 thread_contentions;
712 guint32 thread_queue_len;
713 guint32 thread_queue_max;
714 guint32 thread_num_logical;
715 guint32 thread_num_physical;
716 guint32 thread_cur_recognized;
717 guint32 thread_num_recognized;
718 /* Interop category */
719 guint32 interop_num_ccw;
720 guint32 interop_num_stubs;
721 guint32 interop_num_marshals;
722 /* Security category */
723 guint32 security_num_checks;
724 guint32 security_num_link_checks;
725 guint32 security_time;
726 guint32 security_depth;
730 extern MonoPerfCounters *mono_perfcounters MONO_INTERNAL;
732 void mono_perfcounters_init (void);
735 * The definition of the first field in SafeHandle,
736 * Keep in sync with SafeHandle.cs, this is only used
737 * to access the `handle' parameter.
745 * Keep in sync with HandleRef.cs
753 MONO_GENERIC_SHARING_NONE,
754 MONO_GENERIC_SHARING_COLLECTIONS,
755 MONO_GENERIC_SHARING_CORLIB,
756 MONO_GENERIC_SHARING_ALL
760 * Flags for which contexts were used in inflating a generic.
763 MONO_GENERIC_CONTEXT_USED_CLASS = 1,
764 MONO_GENERIC_CONTEXT_USED_METHOD = 2
767 #define MONO_GENERIC_CONTEXT_USED_BOTH (MONO_GENERIC_CONTEXT_USED_CLASS | MONO_GENERIC_CONTEXT_USED_METHOD)
769 extern MonoStats mono_stats MONO_INTERNAL;
771 typedef gpointer (*MonoTrampoline) (MonoMethod *method);
772 typedef gpointer (*MonoJumpTrampoline) (MonoDomain *domain, MonoMethod *method, gboolean add_sync_wrapper);
773 typedef gpointer (*MonoRemotingTrampoline) (MonoDomain *domain, MonoMethod *method, MonoRemotingTarget target);
774 typedef gpointer (*MonoDelegateTrampoline) (MonoClass *klass);
776 typedef gpointer (*MonoLookupDynamicToken) (MonoImage *image, guint32 token, gboolean valid_token, MonoClass **handle_class, MonoGenericContext *context);
778 typedef gboolean (*MonoGetCachedClassInfo) (MonoClass *klass, MonoCachedClassInfo *res);
780 typedef gboolean (*MonoGetClassFromName) (MonoImage *image, const char *name_space, const char *name, MonoClass **res);
783 mono_classes_init (void) MONO_INTERNAL;
786 mono_classes_cleanup (void) MONO_INTERNAL;
789 mono_class_layout_fields (MonoClass *klass) MONO_INTERNAL;
792 mono_class_setup_interface_offsets (MonoClass *klass) MONO_INTERNAL;
795 mono_class_setup_vtable_general (MonoClass *klass, MonoMethod **overrides, int onum) MONO_INTERNAL;
798 mono_class_setup_vtable (MonoClass *klass) MONO_INTERNAL;
801 mono_class_setup_methods (MonoClass *klass) MONO_INTERNAL;
804 mono_class_setup_mono_type (MonoClass *klass) MONO_INTERNAL;
807 mono_class_setup_parent (MonoClass *klass, MonoClass *parent) MONO_INTERNAL;
810 mono_class_setup_supertypes (MonoClass *klass) MONO_INTERNAL;
813 mono_class_get_method_by_index (MonoClass *class, int index) MONO_INTERNAL;
816 mono_class_get_inflated_method (MonoClass *class, MonoMethod *method) MONO_INTERNAL;
819 mono_class_get_vtable_entry (MonoClass *class, int offset) MONO_INTERNAL;
822 mono_class_get_implemented_interfaces (MonoClass *klass) MONO_INTERNAL;
825 mono_class_is_open_constructed_type (MonoType *t) MONO_INTERNAL;
828 mono_class_get_overrides_full (MonoImage *image, guint32 type_token, MonoMethod ***overrides, gint32 *num_overrides,
829 MonoGenericContext *generic_context) MONO_INTERNAL;
832 mono_class_get_cctor (MonoClass *klass) MONO_INTERNAL;
835 mono_class_get_finalizer (MonoClass *klass) MONO_INTERNAL;
838 mono_class_needs_cctor_run (MonoClass *klass, MonoMethod *caller) MONO_INTERNAL;
841 mono_class_field_is_special_static (MonoClassField *field) MONO_INTERNAL;
844 mono_class_has_special_static_fields (MonoClass *klass) MONO_INTERNAL;
847 mono_class_get_field_default_value (MonoClassField *field, MonoTypeEnum *def_type) MONO_INTERNAL;
850 mono_install_trampoline (MonoTrampoline func) MONO_INTERNAL;
853 mono_install_jump_trampoline (MonoJumpTrampoline func) MONO_INTERNAL;
856 mono_install_remoting_trampoline (MonoRemotingTrampoline func) MONO_INTERNAL;
859 mono_install_delegate_trampoline (MonoDelegateTrampoline func) MONO_INTERNAL;
862 mono_lookup_dynamic_token (MonoImage *image, guint32 token, MonoGenericContext *context) MONO_INTERNAL;
865 mono_lookup_dynamic_token_class (MonoImage *image, guint32 token, gboolean check_token, MonoClass **handle_class, MonoGenericContext *context) MONO_INTERNAL;
868 mono_install_lookup_dynamic_token (MonoLookupDynamicToken func) MONO_INTERNAL;
871 mono_runtime_create_jump_trampoline (MonoDomain *domain, MonoMethod *method, gboolean add_sync_wrapper) MONO_INTERNAL;
874 mono_runtime_create_delegate_trampoline (MonoClass *klass) MONO_INTERNAL;
877 mono_install_get_cached_class_info (MonoGetCachedClassInfo func) MONO_INTERNAL;
880 mono_install_get_class_from_name (MonoGetClassFromName func) MONO_INTERNAL;
883 mono_class_get_context (MonoClass *class) MONO_INTERNAL;
886 mono_method_get_context_general (MonoMethod *method, gboolean uninflated) MONO_INTERNAL;
889 mono_method_get_context (MonoMethod *method) MONO_INTERNAL;
891 /* Used by monodis, thus cannot be MONO_INTERNAL */
892 MonoGenericContainer*
893 mono_method_get_generic_container (MonoMethod *method);
896 mono_generic_class_get_context (MonoGenericClass *gclass) MONO_INTERNAL;
899 mono_generic_class_get_class (MonoGenericClass *gclass) MONO_INTERNAL;
902 mono_method_set_generic_container (MonoMethod *method, MonoGenericContainer* container) MONO_INTERNAL;
905 mono_class_inflate_generic_method_full (MonoMethod *method, MonoClass *klass_hint, MonoGenericContext *context);
908 mono_method_inflated_lookup (MonoMethodInflated* method, gboolean cache) MONO_INTERNAL;
910 MonoMethodSignature *
911 mono_metadata_get_inflated_signature (MonoMethodSignature *sig, MonoGenericContext *context);
914 mono_class_inflate_generic_type_with_mempool (MonoImage *image, MonoType *type, MonoGenericContext *context) MONO_INTERNAL;
917 mono_class_inflate_generic_class (MonoClass *gklass, MonoGenericContext *context) MONO_INTERNAL;
920 mono_metadata_free_inflated_signature (MonoMethodSignature *sig);
924 MonoClass *object_class;
925 MonoClass *byte_class;
926 MonoClass *void_class;
927 MonoClass *boolean_class;
928 MonoClass *sbyte_class;
929 MonoClass *int16_class;
930 MonoClass *uint16_class;
931 MonoClass *int32_class;
932 MonoClass *uint32_class;
933 MonoClass *int_class;
934 MonoClass *uint_class;
935 MonoClass *int64_class;
936 MonoClass *uint64_class;
937 MonoClass *single_class;
938 MonoClass *double_class;
939 MonoClass *char_class;
940 MonoClass *string_class;
941 MonoClass *enum_class;
942 MonoClass *array_class;
943 MonoClass *delegate_class;
944 MonoClass *multicastdelegate_class;
945 MonoClass *asyncresult_class;
946 MonoClass *waithandle_class;
947 MonoClass *typehandle_class;
948 MonoClass *fieldhandle_class;
949 MonoClass *methodhandle_class;
950 MonoClass *systemtype_class;
951 MonoClass *monotype_class;
952 MonoClass *exception_class;
953 MonoClass *threadabortexception_class;
954 MonoClass *thread_class;
955 MonoClass *transparent_proxy_class;
956 MonoClass *real_proxy_class;
957 MonoClass *mono_method_message_class;
958 MonoClass *appdomain_class;
959 MonoClass *field_info_class;
960 MonoClass *method_info_class;
961 MonoClass *stringbuilder_class;
962 MonoClass *math_class;
963 MonoClass *stack_frame_class;
964 MonoClass *stack_trace_class;
965 MonoClass *marshal_class;
966 MonoClass *iserializeable_class;
967 MonoClass *serializationinfo_class;
968 MonoClass *streamingcontext_class;
969 MonoClass *typed_reference_class;
970 MonoClass *argumenthandle_class;
971 MonoClass *marshalbyrefobject_class;
972 MonoClass *monitor_class;
973 MonoClass *iremotingtypeinfo_class;
974 MonoClass *runtimesecurityframe_class;
975 MonoClass *executioncontext_class;
976 MonoClass *internals_visible_class;
977 MonoClass *generic_ilist_class;
978 MonoClass *generic_nullable_class;
979 MonoClass *variant_class;
980 MonoClass *com_object_class;
981 MonoClass *com_interop_proxy_class;
982 MonoClass *iunknown_class;
983 MonoClass *idispatch_class;
984 MonoClass *safehandle_class;
985 MonoClass *handleref_class;
986 MonoClass *attribute_class;
987 MonoClass *customattribute_data_class;
988 MonoClass *critical_finalizer_object;
991 extern MonoDefaults mono_defaults MONO_INTERNAL;
994 mono_loader_init (void) MONO_INTERNAL;
997 mono_loader_cleanup (void) MONO_INTERNAL;
1000 mono_loader_lock (void) MONO_INTERNAL;
1003 mono_loader_unlock (void) MONO_INTERNAL;
1006 mono_loader_set_error_assembly_load (const char *assembly_name, gboolean ref_only) MONO_INTERNAL;
1009 mono_loader_set_error_type_load (const char *class_name, const char *assembly_name) MONO_INTERNAL;
1012 mono_loader_set_error_method_load (const char *class_name, const char *member_name) MONO_INTERNAL;
1015 mono_loader_set_error_field_load (MonoClass *klass, const char *member_name) MONO_INTERNAL;
1017 mono_loader_set_error_bad_image (char *msg) MONO_INTERNAL;
1020 mono_loader_error_prepare_exception (MonoLoaderError *error) MONO_INTERNAL;
1023 mono_loader_get_last_error (void) MONO_INTERNAL;
1026 mono_loader_clear_error (void) MONO_INTERNAL;
1029 mono_reflection_init (void) MONO_INTERNAL;
1032 mono_icall_init (void) MONO_INTERNAL;
1035 mono_icall_cleanup (void) MONO_INTERNAL;
1038 mono_method_get_wrapper_data (MonoMethod *method, guint32 id) MONO_INTERNAL;
1041 mono_install_stack_walk (MonoStackWalkImpl func) MONO_INTERNAL;
1044 mono_metadata_has_generic_params (MonoImage *image, guint32 token) MONO_INTERNAL;
1046 MonoGenericContainer *
1047 mono_metadata_load_generic_params (MonoImage *image, guint32 token,
1048 MonoGenericContainer *parent_container);
1051 mono_metadata_load_generic_param_constraints (MonoImage *image, guint32 token,
1052 MonoGenericContainer *container);
1054 MonoMethodSignature*
1055 mono_create_icall_signature (const char *sigstr) MONO_INTERNAL;
1058 mono_register_jit_icall (gconstpointer func, const char *name, MonoMethodSignature *sig, gboolean is_save) MONO_INTERNAL;
1061 mono_register_jit_icall_wrapper (MonoJitICallInfo *info, gconstpointer wrapper) MONO_INTERNAL;
1064 mono_find_jit_icall_by_name (const char *name) MONO_INTERNAL;
1067 mono_find_jit_icall_by_addr (gconstpointer addr) MONO_INTERNAL;
1070 mono_get_jit_icall_info (void) MONO_INTERNAL;
1073 mono_class_set_failure (MonoClass *klass, guint32 ex_type, void *ex_data) MONO_INTERNAL;
1076 mono_class_get_exception_data (MonoClass *klass) MONO_INTERNAL;
1079 mono_class_get_exception_for_failure (MonoClass *klass) MONO_INTERNAL;
1082 mono_type_get_name_full (MonoType *type, MonoTypeNameFormat format) MONO_INTERNAL;
1085 mono_type_get_full_name (MonoClass *class) MONO_INTERNAL;
1087 MonoArrayType *mono_dup_array_type (MonoImage *image, MonoArrayType *a) MONO_INTERNAL;
1088 MonoMethodSignature *mono_metadata_signature_deep_dup (MonoImage *image, MonoMethodSignature *sig) MONO_INTERNAL;
1091 mono_image_init_name_cache (MonoImage *image);
1093 gboolean mono_class_is_nullable (MonoClass *klass) MONO_INTERNAL;
1094 MonoClass *mono_class_get_nullable_param (MonoClass *klass) MONO_INTERNAL;
1096 /* object debugging functions, for use inside gdb */
1097 void mono_object_describe (MonoObject *obj);
1098 void mono_object_describe_fields (MonoObject *obj);
1099 void mono_value_describe_fields (MonoClass* klass, const char* addr);
1100 void mono_class_describe_statics (MonoClass* klass);
1102 /*Enum validation related functions*/
1104 mono_type_is_valid_enum_basetype (MonoType * type);
1107 mono_class_is_valid_enum (MonoClass *klass);
1110 mono_type_get_full (MonoImage *image, guint32 type_token, MonoGenericContext *context) MONO_INTERNAL;
1113 mono_generic_class_is_generic_type_definition (MonoGenericClass *gklass) MONO_INTERNAL;
1116 mono_method_get_declaring_generic_method (MonoMethod *method) MONO_INTERNAL;
1119 mono_class_get_method_generic (MonoClass *klass, MonoMethod *method) MONO_INTERNAL;
1122 mono_type_get_basic_type_from_generic (MonoType *type) MONO_INTERNAL;
1125 mono_class_generic_sharing_enabled (MonoClass *class) MONO_INTERNAL;
1128 mono_class_fill_runtime_generic_context (MonoVTable *class_vtable, guint32 slot) MONO_INTERNAL;
1131 mono_method_fill_runtime_generic_context (MonoMethodRuntimeGenericContext *mrgctx, guint32 slot) MONO_INTERNAL;
1133 MonoMethodRuntimeGenericContext*
1134 mono_method_lookup_rgctx (MonoVTable *class_vtable, MonoGenericInst *method_inst) MONO_INTERNAL;
1137 mono_method_needs_static_rgctx_invoke (MonoMethod *method, gboolean allow_type_vars) MONO_INTERNAL;
1140 mono_class_rgctx_get_array_size (int n, gboolean mrgctx) MONO_INTERNAL;
1143 mono_method_lookup_or_register_other_info (MonoMethod *method, gboolean in_mrgctx, gpointer data,
1144 int info_type, MonoGenericContext *generic_context) MONO_INTERNAL;
1147 mono_method_construct_object_context (MonoMethod *method) MONO_INTERNAL;
1150 mono_generic_context_check_used (MonoGenericContext *context) MONO_INTERNAL;
1153 mono_class_check_context_used (MonoClass *class) MONO_INTERNAL;
1156 mono_generic_context_is_sharable (MonoGenericContext *context, gboolean allow_type_vars) MONO_INTERNAL;
1159 mono_method_is_generic_impl (MonoMethod *method) MONO_INTERNAL;
1161 mono_method_is_generic_sharable_impl (MonoMethod *method, gboolean allow_type_vars) MONO_INTERNAL;
1164 mono_class_unregister_image_generic_subclasses (MonoImage *image) MONO_INTERNAL;
1167 mono_method_can_access_method_full (MonoMethod *method, MonoMethod *called, MonoClass *context_klass) MONO_INTERNAL;
1170 mono_method_can_access_field_full (MonoMethod *method, MonoClassField *field, MonoClass *context_klass) MONO_INTERNAL;
1173 mono_class_get_generic_type_definition (MonoClass *klass) MONO_INTERNAL;
1176 mono_class_has_parent_and_ignore_generics (MonoClass *klass, MonoClass *parent) MONO_INTERNAL;
1179 mono_method_get_vtable_slot (MonoMethod *method) MONO_INTERNAL;
1182 mono_method_get_vtable_index (MonoMethod *method) MONO_INTERNAL;
1185 mono_method_search_in_array_class (MonoClass *klass, const char *name, MonoMethodSignature *sig) MONO_INTERNAL;
1188 mono_class_setup_interface_id (MonoClass *class) MONO_INTERNAL;
1190 MonoGenericContainer*
1191 mono_class_get_generic_container (MonoClass *klass) MONO_INTERNAL;
1194 mono_class_get_generic_class (MonoClass *klass) MONO_INTERNAL;
1197 mono_class_alloc_ext (MonoClass *klass) MONO_INTERNAL;
1200 mono_class_setup_interfaces (MonoClass *klass) MONO_INTERNAL;
1202 #endif /* __MONO_METADATA_CLASS_INTERBALS_H__ */