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;
542 struct _MonoGenericParam {
543 MonoGenericContainer *owner; /* Type or method this parameter was defined in. */
544 MonoClass *pklass; /* The corresponding `MonoClass'. */
548 MonoClass** constraints; /* NULL means end of list */
549 /* If owner is NULL, this is the image whose mempool this struct was allocated from */
554 * Class information which might be cached by the runtime in the AOT file for
555 * example. Caching this allows us to avoid computing a generic vtable
556 * (class->vtable) in most cases, saving time and avoiding creation of lots of
557 * MonoMethod structures.
559 typedef struct MonoCachedClassInfo {
561 guint has_finalize : 1;
564 guint has_nested_classes : 1;
566 guint has_references : 1;
567 guint has_static_refs : 1;
568 guint no_special_static_fields : 1;
570 MonoImage *finalize_image;
571 guint32 finalize_token;
572 guint32 instance_size;
574 guint32 packing_size;
576 } MonoCachedClassInfo;
581 gconstpointer wrapper;
582 gconstpointer trampoline;
583 MonoMethodSignature *sig;
587 guint8 exception_type;
588 char *class_name; /* If kind == TYPE */
589 char *assembly_name; /* If kind == TYPE or ASSEMBLY */
590 MonoClass *klass; /* If kind != TYPE */
591 const char *member_name; /* If kind != TYPE */
592 gboolean ref_only; /* If kind == ASSEMBLY */
593 char *msg; /* If kind == BAD_IMAGE */
596 #define mono_class_has_parent(klass,parent) (((klass)->idepth >= (parent)->idepth) && ((klass)->supertypes [(parent)->idepth - 1] == (parent)))
599 gulong new_object_count;
600 gulong initialized_class_count;
601 gulong generic_vtable_count;
602 gulong used_class_count;
604 gulong class_vtable_size;
605 gulong class_static_data_size;
606 gulong generic_instance_count;
607 gulong generic_class_count;
608 gulong inflated_method_count;
609 gulong inflated_method_count_2;
610 gulong inflated_type_count;
611 gulong generics_metadata_size;
612 gulong dynamic_code_alloc_count;
613 gulong dynamic_code_bytes_count;
614 gulong dynamic_code_frees_count;
615 gulong delegate_creations;
616 gulong imt_tables_size;
617 gulong imt_number_of_tables;
618 gulong imt_number_of_methods;
619 gulong imt_used_slots;
620 gulong imt_slots_with_collisions;
621 gulong imt_max_collisions_in_slot;
622 gulong imt_method_count_when_max_collisions;
623 gulong imt_thunks_size;
624 gulong jit_info_table_insert_count;
625 gulong jit_info_table_remove_count;
626 gulong jit_info_table_lookup_count;
627 gulong hazardous_pointer_count;
628 gulong generics_sharable_methods;
629 gulong generics_unsharable_methods;
630 gulong generics_shared_methods;
631 gulong minor_gc_count;
632 gulong major_gc_count;
633 gulong minor_gc_time_usecs;
634 gulong major_gc_time_usecs;
639 * new structure to hold performace counters values that are exported
641 * Note: never remove fields from this structure and only add them to the end.
642 * Size of fields and type should not be changed as well.
649 guint32 jit_failures;
650 /* Exceptions category */
651 guint32 exceptions_thrown;
652 guint32 exceptions_filters;
653 guint32 exceptions_finallys;
654 guint32 exceptions_depth;
655 guint32 aspnet_requests_queued;
656 guint32 aspnet_requests;
657 /* Memory category */
658 guint32 gc_collections0;
659 guint32 gc_collections1;
660 guint32 gc_collections2;
661 guint32 gc_promotions0;
662 guint32 gc_promotions1;
663 guint32 gc_promotion_finalizers;
668 guint32 gc_fin_survivors;
669 guint32 gc_num_handles;
670 guint32 gc_allocated;
673 guint32 gc_total_bytes;
674 guint32 gc_committed_bytes;
675 guint32 gc_reserved_bytes;
676 guint32 gc_num_pinned;
677 guint32 gc_sync_blocks;
678 /* Remoting category */
679 guint32 remoting_calls;
680 guint32 remoting_channels;
681 guint32 remoting_proxies;
682 guint32 remoting_classes;
683 guint32 remoting_objects;
684 guint32 remoting_contexts;
685 /* Loader category */
686 guint32 loader_classes;
687 guint32 loader_total_classes;
688 guint32 loader_appdomains;
689 guint32 loader_total_appdomains;
690 guint32 loader_assemblies;
691 guint32 loader_total_assemblies;
692 guint32 loader_failures;
693 guint32 loader_bytes;
694 guint32 loader_appdomains_uloaded;
695 /* Threads and Locks category */
696 guint32 thread_contentions;
697 guint32 thread_queue_len;
698 guint32 thread_queue_max;
699 guint32 thread_num_logical;
700 guint32 thread_num_physical;
701 guint32 thread_cur_recognized;
702 guint32 thread_num_recognized;
703 /* Interop category */
704 guint32 interop_num_ccw;
705 guint32 interop_num_stubs;
706 guint32 interop_num_marshals;
707 /* Security category */
708 guint32 security_num_checks;
709 guint32 security_num_link_checks;
710 guint32 security_time;
711 guint32 security_depth;
715 extern MonoPerfCounters *mono_perfcounters MONO_INTERNAL;
717 void mono_perfcounters_init (void);
720 * The definition of the first field in SafeHandle,
721 * Keep in sync with SafeHandle.cs, this is only used
722 * to access the `handle' parameter.
730 * Keep in sync with HandleRef.cs
738 MONO_GENERIC_SHARING_NONE,
739 MONO_GENERIC_SHARING_COLLECTIONS,
740 MONO_GENERIC_SHARING_CORLIB,
741 MONO_GENERIC_SHARING_ALL
745 * Flags for which contexts were used in inflating a generic.
748 MONO_GENERIC_CONTEXT_USED_CLASS = 1,
749 MONO_GENERIC_CONTEXT_USED_METHOD = 2
752 #define MONO_GENERIC_CONTEXT_USED_BOTH (MONO_GENERIC_CONTEXT_USED_CLASS | MONO_GENERIC_CONTEXT_USED_METHOD)
754 extern MonoStats mono_stats MONO_INTERNAL;
756 typedef gpointer (*MonoTrampoline) (MonoMethod *method);
757 typedef gpointer (*MonoJumpTrampoline) (MonoDomain *domain, MonoMethod *method, gboolean add_sync_wrapper);
758 typedef gpointer (*MonoRemotingTrampoline) (MonoDomain *domain, MonoMethod *method, MonoRemotingTarget target);
759 typedef gpointer (*MonoDelegateTrampoline) (MonoClass *klass);
761 typedef gpointer (*MonoLookupDynamicToken) (MonoImage *image, guint32 token, gboolean valid_token, MonoClass **handle_class, MonoGenericContext *context);
763 typedef gboolean (*MonoGetCachedClassInfo) (MonoClass *klass, MonoCachedClassInfo *res);
765 typedef gboolean (*MonoGetClassFromName) (MonoImage *image, const char *name_space, const char *name, MonoClass **res);
768 mono_classes_init (void) MONO_INTERNAL;
771 mono_classes_cleanup (void) MONO_INTERNAL;
774 mono_class_layout_fields (MonoClass *klass) MONO_INTERNAL;
777 mono_class_setup_interface_offsets (MonoClass *klass) MONO_INTERNAL;
780 mono_class_setup_vtable_general (MonoClass *klass, MonoMethod **overrides, int onum) MONO_INTERNAL;
783 mono_class_setup_vtable (MonoClass *klass) MONO_INTERNAL;
786 mono_class_setup_methods (MonoClass *klass) MONO_INTERNAL;
789 mono_class_setup_mono_type (MonoClass *klass) MONO_INTERNAL;
792 mono_class_setup_parent (MonoClass *klass, MonoClass *parent) MONO_INTERNAL;
795 mono_class_setup_supertypes (MonoClass *klass) MONO_INTERNAL;
798 mono_class_get_method_by_index (MonoClass *class, int index) MONO_INTERNAL;
801 mono_class_get_inflated_method (MonoClass *class, MonoMethod *method) MONO_INTERNAL;
804 mono_class_get_vtable_entry (MonoClass *class, int offset) MONO_INTERNAL;
807 mono_class_get_implemented_interfaces (MonoClass *klass) MONO_INTERNAL;
810 mono_class_is_open_constructed_type (MonoType *t) MONO_INTERNAL;
813 mono_class_get_overrides_full (MonoImage *image, guint32 type_token, MonoMethod ***overrides, gint32 *num_overrides,
814 MonoGenericContext *generic_context) MONO_INTERNAL;
817 mono_class_get_cctor (MonoClass *klass) MONO_INTERNAL;
820 mono_class_get_finalizer (MonoClass *klass) MONO_INTERNAL;
823 mono_class_needs_cctor_run (MonoClass *klass, MonoMethod *caller) MONO_INTERNAL;
826 mono_class_field_is_special_static (MonoClassField *field) MONO_INTERNAL;
829 mono_class_has_special_static_fields (MonoClass *klass) MONO_INTERNAL;
832 mono_class_get_field_default_value (MonoClassField *field, MonoTypeEnum *def_type) MONO_INTERNAL;
835 mono_install_trampoline (MonoTrampoline func) MONO_INTERNAL;
838 mono_install_jump_trampoline (MonoJumpTrampoline func) MONO_INTERNAL;
841 mono_install_remoting_trampoline (MonoRemotingTrampoline func) MONO_INTERNAL;
844 mono_install_delegate_trampoline (MonoDelegateTrampoline func) MONO_INTERNAL;
847 mono_lookup_dynamic_token (MonoImage *image, guint32 token, MonoGenericContext *context) MONO_INTERNAL;
850 mono_lookup_dynamic_token_class (MonoImage *image, guint32 token, gboolean check_token, MonoClass **handle_class, MonoGenericContext *context) MONO_INTERNAL;
853 mono_install_lookup_dynamic_token (MonoLookupDynamicToken func) MONO_INTERNAL;
856 mono_runtime_create_jump_trampoline (MonoDomain *domain, MonoMethod *method, gboolean add_sync_wrapper) MONO_INTERNAL;
859 mono_runtime_create_delegate_trampoline (MonoClass *klass) MONO_INTERNAL;
862 mono_install_get_cached_class_info (MonoGetCachedClassInfo func) MONO_INTERNAL;
865 mono_install_get_class_from_name (MonoGetClassFromName func) MONO_INTERNAL;
868 mono_class_get_context (MonoClass *class) MONO_INTERNAL;
871 mono_method_get_context_general (MonoMethod *method, gboolean uninflated) MONO_INTERNAL;
874 mono_method_get_context (MonoMethod *method) MONO_INTERNAL;
876 /* Used by monodis, thus cannot be MONO_INTERNAL */
877 MonoGenericContainer*
878 mono_method_get_generic_container (MonoMethod *method);
881 mono_generic_class_get_context (MonoGenericClass *gclass) MONO_INTERNAL;
884 mono_generic_class_get_class (MonoGenericClass *gclass) MONO_INTERNAL;
887 mono_method_set_generic_container (MonoMethod *method, MonoGenericContainer* container) MONO_INTERNAL;
890 mono_class_inflate_generic_method_full (MonoMethod *method, MonoClass *klass_hint, MonoGenericContext *context);
893 mono_method_inflated_lookup (MonoMethodInflated* method, gboolean cache) MONO_INTERNAL;
895 MonoMethodSignature *
896 mono_metadata_get_inflated_signature (MonoMethodSignature *sig, MonoGenericContext *context);
899 mono_class_inflate_generic_type_with_mempool (MonoImage *image, MonoType *type, MonoGenericContext *context) MONO_INTERNAL;
902 mono_class_inflate_generic_class (MonoClass *gklass, MonoGenericContext *context) MONO_INTERNAL;
905 mono_metadata_free_inflated_signature (MonoMethodSignature *sig);
909 MonoClass *object_class;
910 MonoClass *byte_class;
911 MonoClass *void_class;
912 MonoClass *boolean_class;
913 MonoClass *sbyte_class;
914 MonoClass *int16_class;
915 MonoClass *uint16_class;
916 MonoClass *int32_class;
917 MonoClass *uint32_class;
918 MonoClass *int_class;
919 MonoClass *uint_class;
920 MonoClass *int64_class;
921 MonoClass *uint64_class;
922 MonoClass *single_class;
923 MonoClass *double_class;
924 MonoClass *char_class;
925 MonoClass *string_class;
926 MonoClass *enum_class;
927 MonoClass *array_class;
928 MonoClass *delegate_class;
929 MonoClass *multicastdelegate_class;
930 MonoClass *asyncresult_class;
931 MonoClass *waithandle_class;
932 MonoClass *typehandle_class;
933 MonoClass *fieldhandle_class;
934 MonoClass *methodhandle_class;
935 MonoClass *systemtype_class;
936 MonoClass *monotype_class;
937 MonoClass *exception_class;
938 MonoClass *threadabortexception_class;
939 MonoClass *thread_class;
940 MonoClass *transparent_proxy_class;
941 MonoClass *real_proxy_class;
942 MonoClass *mono_method_message_class;
943 MonoClass *appdomain_class;
944 MonoClass *field_info_class;
945 MonoClass *method_info_class;
946 MonoClass *stringbuilder_class;
947 MonoClass *math_class;
948 MonoClass *stack_frame_class;
949 MonoClass *stack_trace_class;
950 MonoClass *marshal_class;
951 MonoClass *iserializeable_class;
952 MonoClass *serializationinfo_class;
953 MonoClass *streamingcontext_class;
954 MonoClass *typed_reference_class;
955 MonoClass *argumenthandle_class;
956 MonoClass *marshalbyrefobject_class;
957 MonoClass *monitor_class;
958 MonoClass *iremotingtypeinfo_class;
959 MonoClass *runtimesecurityframe_class;
960 MonoClass *executioncontext_class;
961 MonoClass *internals_visible_class;
962 MonoClass *generic_ilist_class;
963 MonoClass *generic_nullable_class;
964 MonoClass *variant_class;
965 MonoClass *com_object_class;
966 MonoClass *com_interop_proxy_class;
967 MonoClass *iunknown_class;
968 MonoClass *idispatch_class;
969 MonoClass *safehandle_class;
970 MonoClass *handleref_class;
971 MonoClass *attribute_class;
972 MonoClass *customattribute_data_class;
975 extern MonoDefaults mono_defaults MONO_INTERNAL;
978 mono_loader_init (void) MONO_INTERNAL;
981 mono_loader_cleanup (void) MONO_INTERNAL;
984 mono_loader_lock (void) MONO_INTERNAL;
987 mono_loader_unlock (void) MONO_INTERNAL;
990 mono_loader_set_error_assembly_load (const char *assembly_name, gboolean ref_only) MONO_INTERNAL;
993 mono_loader_set_error_type_load (const char *class_name, const char *assembly_name) MONO_INTERNAL;
996 mono_loader_set_error_method_load (const char *class_name, const char *member_name) MONO_INTERNAL;
999 mono_loader_set_error_field_load (MonoClass *klass, const char *member_name) MONO_INTERNAL;
1001 mono_loader_set_error_bad_image (char *msg) MONO_INTERNAL;
1004 mono_loader_error_prepare_exception (MonoLoaderError *error) MONO_INTERNAL;
1007 mono_loader_get_last_error (void) MONO_INTERNAL;
1010 mono_loader_clear_error (void) MONO_INTERNAL;
1013 mono_reflection_init (void) MONO_INTERNAL;
1016 mono_icall_init (void) MONO_INTERNAL;
1019 mono_icall_cleanup (void) MONO_INTERNAL;
1022 mono_method_get_wrapper_data (MonoMethod *method, guint32 id) MONO_INTERNAL;
1025 mono_install_stack_walk (MonoStackWalkImpl func) MONO_INTERNAL;
1028 mono_metadata_has_generic_params (MonoImage *image, guint32 token) MONO_INTERNAL;
1030 MonoGenericContainer *
1031 mono_metadata_load_generic_params (MonoImage *image, guint32 token,
1032 MonoGenericContainer *parent_container);
1035 mono_metadata_load_generic_param_constraints (MonoImage *image, guint32 token,
1036 MonoGenericContainer *container);
1038 MonoMethodSignature*
1039 mono_create_icall_signature (const char *sigstr) MONO_INTERNAL;
1042 mono_register_jit_icall (gconstpointer func, const char *name, MonoMethodSignature *sig, gboolean is_save) MONO_INTERNAL;
1045 mono_register_jit_icall_wrapper (MonoJitICallInfo *info, gconstpointer wrapper) MONO_INTERNAL;
1048 mono_find_jit_icall_by_name (const char *name) MONO_INTERNAL;
1051 mono_find_jit_icall_by_addr (gconstpointer addr) MONO_INTERNAL;
1054 mono_get_jit_icall_info (void) MONO_INTERNAL;
1057 mono_class_set_failure (MonoClass *klass, guint32 ex_type, void *ex_data) MONO_INTERNAL;
1060 mono_class_get_exception_data (MonoClass *klass) MONO_INTERNAL;
1063 mono_class_get_exception_for_failure (MonoClass *klass) MONO_INTERNAL;
1066 mono_type_get_name_full (MonoType *type, MonoTypeNameFormat format) MONO_INTERNAL;
1069 mono_type_get_full_name (MonoClass *class) MONO_INTERNAL;
1071 MonoArrayType *mono_dup_array_type (MonoImage *image, MonoArrayType *a) MONO_INTERNAL;
1072 MonoMethodSignature *mono_metadata_signature_deep_dup (MonoImage *image, MonoMethodSignature *sig) MONO_INTERNAL;
1075 mono_image_init_name_cache (MonoImage *image);
1077 gboolean mono_class_is_nullable (MonoClass *klass) MONO_INTERNAL;
1078 MonoClass *mono_class_get_nullable_param (MonoClass *klass) MONO_INTERNAL;
1080 /* object debugging functions, for use inside gdb */
1081 void mono_object_describe (MonoObject *obj);
1082 void mono_object_describe_fields (MonoObject *obj);
1083 void mono_value_describe_fields (MonoClass* klass, const char* addr);
1084 void mono_class_describe_statics (MonoClass* klass);
1086 /*Enum validation related functions*/
1088 mono_type_is_valid_enum_basetype (MonoType * type);
1091 mono_class_is_valid_enum (MonoClass *klass);
1094 mono_type_get_full (MonoImage *image, guint32 type_token, MonoGenericContext *context) MONO_INTERNAL;
1097 mono_generic_class_is_generic_type_definition (MonoGenericClass *gklass) MONO_INTERNAL;
1100 mono_method_get_declaring_generic_method (MonoMethod *method) MONO_INTERNAL;
1103 mono_class_get_method_generic (MonoClass *klass, MonoMethod *method) MONO_INTERNAL;
1106 mono_type_get_basic_type_from_generic (MonoType *type) MONO_INTERNAL;
1109 mono_class_generic_sharing_enabled (MonoClass *class) MONO_INTERNAL;
1112 mono_class_fill_runtime_generic_context (MonoVTable *class_vtable, guint32 slot) MONO_INTERNAL;
1115 mono_method_fill_runtime_generic_context (MonoMethodRuntimeGenericContext *mrgctx, guint32 slot) MONO_INTERNAL;
1117 MonoMethodRuntimeGenericContext*
1118 mono_method_lookup_rgctx (MonoVTable *class_vtable, MonoGenericInst *method_inst) MONO_INTERNAL;
1121 mono_method_needs_static_rgctx_invoke (MonoMethod *method, gboolean allow_type_vars) MONO_INTERNAL;
1124 mono_class_rgctx_get_array_size (int n, gboolean mrgctx) MONO_INTERNAL;
1127 mono_method_lookup_or_register_other_info (MonoMethod *method, gboolean in_mrgctx, gpointer data,
1128 int info_type, MonoGenericContext *generic_context) MONO_INTERNAL;
1131 mono_method_construct_object_context (MonoMethod *method) MONO_INTERNAL;
1134 mono_generic_context_check_used (MonoGenericContext *context) MONO_INTERNAL;
1137 mono_class_check_context_used (MonoClass *class) MONO_INTERNAL;
1140 mono_generic_context_is_sharable (MonoGenericContext *context, gboolean allow_type_vars) MONO_INTERNAL;
1143 mono_method_is_generic_impl (MonoMethod *method) MONO_INTERNAL;
1145 mono_method_is_generic_sharable_impl (MonoMethod *method, gboolean allow_type_vars) MONO_INTERNAL;
1148 mono_class_unregister_image_generic_subclasses (MonoImage *image) MONO_INTERNAL;
1151 mono_method_can_access_method_full (MonoMethod *method, MonoMethod *called, MonoClass *context_klass) MONO_INTERNAL;
1154 mono_method_can_access_field_full (MonoMethod *method, MonoClassField *field, MonoClass *context_klass) MONO_INTERNAL;
1157 mono_class_get_generic_type_definition (MonoClass *klass) MONO_INTERNAL;
1160 mono_class_has_parent_and_ignore_generics (MonoClass *klass, MonoClass *parent) MONO_INTERNAL;
1163 mono_method_get_vtable_slot (MonoMethod *method) MONO_INTERNAL;
1166 mono_method_get_vtable_index (MonoMethod *method) MONO_INTERNAL;
1169 mono_method_search_in_array_class (MonoClass *klass, const char *name, MonoMethodSignature *sig) MONO_INTERNAL;
1172 mono_class_setup_interface_id (MonoClass *class) MONO_INTERNAL;
1174 MonoGenericContainer*
1175 mono_class_get_generic_container (MonoClass *klass) MONO_INTERNAL;
1178 mono_class_get_generic_class (MonoClass *klass) MONO_INTERNAL;
1181 mono_class_alloc_ext (MonoClass *klass) MONO_INTERNAL;
1184 mono_class_setup_interfaces (MonoClass *klass) MONO_INTERNAL;
1186 #endif /* __MONO_METADATA_CLASS_INTERBALS_H__ */