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/io-layer/io-layer.h>
7 #include "mono/utils/mono-compiler.h"
9 #define MONO_CLASS_IS_ARRAY(c) ((c)->rank)
11 #define MONO_DEFAULT_SUPERTABLE_SIZE 6
13 extern gboolean mono_print_vtable;
15 extern gboolean mono_setup_vtable_in_class_init;
17 typedef void (*MonoStackWalkImpl) (MonoStackWalk func, gboolean do_il_offset, gpointer user_data);
19 typedef struct _MonoMethodNormal MonoMethodNormal;
20 typedef struct _MonoMethodWrapper MonoMethodWrapper;
21 typedef struct _MonoMethodInflated MonoMethodInflated;
22 typedef struct _MonoMethodPInvoke MonoMethodPInvoke;
25 #define WRAPPER(e,n) MONO_WRAPPER_ ## e,
26 #include "wrapper-types.h"
32 MONO_TYPE_NAME_FORMAT_IL,
33 MONO_TYPE_NAME_FORMAT_REFLECTION,
34 MONO_TYPE_NAME_FORMAT_FULL_NAME,
35 MONO_TYPE_NAME_FORMAT_ASSEMBLY_QUALIFIED
39 MONO_REMOTING_TARGET_UNKNOWN,
40 MONO_REMOTING_TARGET_APPDOMAIN,
41 MONO_REMOTING_TARGET_COMINTEROP
44 #define MONO_METHOD_PROP_GENERIC_CONTAINER 0
47 guint16 flags; /* method flags */
48 guint16 iflags; /* method implementation flags */
51 MonoMethodSignature *signature;
52 /* name is useful mostly for debugging */
54 /* this is used by the inlining algorithm */
55 unsigned int inline_info:1;
56 unsigned int inline_failure:1;
57 unsigned int wrapper_type:5;
58 unsigned int string_ctor:1;
59 unsigned int save_lmf:1;
60 unsigned int dynamic:1; /* created & destroyed during runtime */
61 unsigned int is_generic:1; /* whenever this is a generic method definition */
62 unsigned int is_inflated:1; /* whether we're a MonoMethodInflated */
63 unsigned int skip_visibility:1; /* whenever to skip JIT visibility checks */
64 unsigned int verification_success:1; /* whether this method has been verified successfully.*/
68 * If is_generic is TRUE, the generic_container is stored in image->property_hash,
69 * using the key MONO_METHOD_PROP_GENERIC_CONTAINER.
73 struct _MonoMethodNormal {
75 MonoMethodHeader *header;
78 struct _MonoMethodWrapper {
79 MonoMethodNormal method;
83 struct _MonoMethodPInvoke {
86 /* add marshal info */
87 guint16 piflags; /* pinvoke flags */
88 guint16 implmap_idx; /* index into IMPLMAP */
92 MonoType *generic_type;
93 gpointer reflection_info;
97 * MonoClassField is just a runtime representation of the metadata for
98 * field, it doesn't contain the data directly. Static fields are
99 * stored in MonoVTable->data. Instance fields are allocated in the
100 * objects after the object header.
102 struct _MonoClassField {
103 /* Type of the field */
106 /* If this is an instantiated generic type, this is the
107 * "original" type, ie. the MONO_TYPE_VAR or MONO_TYPE_GENERICINST
108 * it was instantiated from.
110 MonoInflatedField *generic_info;
113 * Offset where this field is stored; if it is an instance
114 * field, it's the offset from the start of the object, if
115 * it's static, it's from the start of the memory chunk
116 * allocated for statics for the class.
123 * If the field is constant, pointer to the metadata constant
125 * If the field has an RVA flag, pointer to the data.
130 /* Type where the field was defined */
134 * If the field is constant, the type of the constant.
136 MonoTypeEnum def_type;
139 /* a field is ignored if it's named "_Deleted" and it has the specialname and rtspecialname flags set */
140 #define mono_field_is_deleted(field) (((field)->type->attrs & (FIELD_ATTRIBUTE_SPECIAL_NAME | FIELD_ATTRIBUTE_RT_SPECIAL_NAME)) \
141 && (strcmp ((field)->name, "_Deleted") == 0))
144 MonoClassField *field;
146 MonoMarshalSpec *mspec;
152 MonoMethod *ptr_to_str;
153 MonoMethod *str_to_ptr;
154 MonoMarshalField fields [MONO_ZERO_LEN_ARRAY];
157 struct _MonoProperty {
175 /* type of exception being "on hold" for later processing (see exception_type) */
177 MONO_EXCEPTION_NONE = 0,
178 MONO_EXCEPTION_SECURITY_LINKDEMAND = 1,
179 MONO_EXCEPTION_SECURITY_INHERITANCEDEMAND = 2,
180 MONO_EXCEPTION_INVALID_PROGRAM = 3,
181 MONO_EXCEPTION_UNVERIFIABLE_IL = 4,
182 MONO_EXCEPTION_MISSING_METHOD = 5,
183 MONO_EXCEPTION_MISSING_FIELD = 6,
184 MONO_EXCEPTION_TYPE_LOAD = 7,
185 MONO_EXCEPTION_FILE_NOT_FOUND = 8,
186 MONO_EXCEPTION_METHOD_ACCESS = 9,
187 MONO_EXCEPTION_FIELD_ACCESS = 10,
188 MONO_EXCEPTION_GENERIC_SHARING_FAILED = 11,
189 MONO_EXCEPTION_BAD_IMAGE = 12
190 /* add other exception type */
193 /* This struct collects the info needed for the runtime use of a class,
194 * like the vtables for a domain, the GC descriptor, etc.
198 /* domain_vtables is indexed by the domain id and the size is max_domain + 1 */
199 MonoVTable *domain_vtables [MONO_ZERO_LEN_ARRAY];
200 } MonoClassRuntimeInfo;
203 MONO_RGCTX_INFO_STATIC_DATA,
204 MONO_RGCTX_INFO_KLASS,
205 MONO_RGCTX_INFO_VTABLE,
206 MONO_RGCTX_INFO_TYPE,
207 MONO_RGCTX_INFO_REFLECTION_TYPE,
208 MONO_RGCTX_INFO_METHOD,
209 MONO_RGCTX_INFO_GENERIC_METHOD_CODE,
210 MONO_RGCTX_INFO_CLASS_FIELD
213 typedef struct _MonoRuntimeGenericContextOtherInfoTemplate {
216 struct _MonoRuntimeGenericContextOtherInfoTemplate *next;
217 } MonoRuntimeGenericContextOtherInfoTemplate;
220 MonoClass *next_subclass;
221 MonoRuntimeGenericContextOtherInfoTemplate *other_infos;
222 } MonoRuntimeGenericContextTemplate;
224 #define MONO_CLASS_PROP_EXCEPTION_DATA 0
227 /* element class for arrays and enum */
228 MonoClass *element_class;
229 /* used for subtype checks */
230 MonoClass *cast_class;
232 /* for fast subtype checks */
233 MonoClass **supertypes;
236 /* array dimension */
239 int instance_size; /* object instance size */
242 /* We use init_pending to detect cyclic calls to mono_class_init */
243 guint init_pending : 1;
245 /* A class contains static and non static data. Static data can be
246 * of the same type as the class itselfs, but it does not influence
247 * the instance size of the class. To avoid cyclic calls to
248 * mono_class_init (from mono_class_instance_size ()) we first
249 * initialise all non static fields. After that we set size_inited
250 * to 1, because we know the instance size now. After that we
251 * initialise all static fields.
253 guint size_inited : 1;
254 guint valuetype : 1; /* derives from System.ValueType */
255 guint enumtype : 1; /* derives from System.Enum */
256 guint blittable : 1; /* class is blittable */
257 guint unicode : 1; /* class uses unicode char when marshalled */
258 guint wastypebuilder : 1; /* class was created at runtime from a TypeBuilder */
261 guint packing_size : 4;
263 guint ghcimpl : 1; /* class has its own GetHashCode impl */
264 guint has_finalize : 1; /* class has its own Finalize impl */
265 guint marshalbyref : 1; /* class is a MarshalByRefObject */
266 guint contextbound : 1; /* class is a ContextBoundObject */
267 guint delegate : 1; /* class is a Delegate */
268 guint gc_descr_inited : 1; /* gc_descr is initialized */
269 guint has_cctor : 1; /* class has a cctor */
270 guint has_references : 1; /* it has GC-tracked references in the instance */
272 guint has_static_refs : 1; /* it has static fields that are GC-tracked */
273 guint no_special_static_fields : 1; /* has no thread/context static fields */
274 /* directly or indirectly derives from ComImport attributed class.
275 * this means we need to create a proxy for instances of this class
276 * for COM Interop. set this flag on loading so all we need is a quick check
277 * during object creation rather than having to traverse supertypes
279 guint is_com_object : 1;
281 guint8 exception_type; /* MONO_EXCEPTION_* */
283 /* Additional information about the exception */
284 /* Stored as property MONO_CLASS_PROP_EXCEPTION_DATA */
285 //void *exception_data;
288 MonoClass *nested_in;
289 GList *nested_classes;
293 const char *name_space;
295 /* The underlying type of the enum */
296 MonoType *enum_basetype;
298 guint32 declsec_flags; /* declarative security attributes flags */
300 int vtable_size; /* number of slots */
302 guint16 interface_count;
303 guint16 interface_id; /* unique inderface id (for interfaces) */
304 guint16 max_interface_id;
306 guint16 interface_offsets_count;
307 MonoClass **interfaces_packed;
308 guint16 *interface_offsets_packed;
309 guint8 *interface_bitmap;
311 MonoClass **interfaces;
314 int class_size; /* size of area for static fields */
315 int element_size; /* for array types */
316 int generic_param_token; /* for generic param types, both var and mvar */
320 * From the TypeDef table
324 guint32 first, count;
325 } field, method, property, event;
327 /* loaded on demand */
328 MonoMarshalType *marshal_info;
331 * Field information: Type and location from object base
333 MonoClassField *fields;
335 /* Initialized by a call to mono_class_setup_properties () */
336 MonoProperty *properties;
338 /* Initialized by a call to mono_class_setup_events () */
341 MonoMethod **methods;
343 /* used as the type of the this argument and when passing the arg by value */
347 MonoGenericClass *generic_class;
348 MonoGenericContainer *generic_container;
350 void *reflection_info;
354 MonoClassRuntimeInfo *runtime_info;
356 /* next element in the class_cache hash list (in MonoImage) */
357 MonoClass *next_class_cache;
359 /* Generic vtable. Initialized by a call to mono_class_setup_vtable () */
363 #define MONO_CLASS_IMPLEMENTS_INTERFACE(k,uiid) (((uiid) <= (k)->max_interface_id) && ((k)->interface_bitmap [(uiid) >> 3] & (1 << ((uiid)&7))))
364 int mono_class_interface_offset (MonoClass *klass, MonoClass *itf);
366 typedef gpointer MonoRuntimeGenericContext;
368 /* the interface_offsets array is stored in memory before this struct */
372 * According to comments in gc_gcj.h, this should be the second word in
376 MonoDomain *domain; /* each object/vtable belongs to exactly one domain */
377 gpointer data; /* to store static class data */
378 gpointer type; /* System.Type type for klass */
379 guint8 *interface_bitmap;
380 guint16 max_interface_id;
382 guint remote : 1; /* class is remotely activated */
383 guint initialized : 1; /* cctor has been run */
384 guint init_failed : 1; /* cctor execution failed */
385 guint32 imt_collisions_bitmap;
386 MonoRuntimeGenericContext *runtime_generic_context;
387 /* do not add any fields after vtable, the structure is dynamically extended */
388 gpointer vtable [MONO_ZERO_LEN_ARRAY];
391 #define MONO_VTABLE_IMPLEMENTS_INTERFACE(vt,uiid) (((uiid) <= (vt)->max_interface_id) && ((vt)->interface_bitmap [(uiid) >> 3] & (1 << ((uiid)&7))))
394 * Generic instantiation data type encoding.
398 * A particular generic instantiation:
400 * All instantiations are cached and we don't distinguish between class and method
401 * instantiations here.
403 struct _MonoGenericInst {
404 guint id; /* unique ID for debugging */
405 guint type_argc : 22; /* number of type arguments */
406 guint is_open : 1; /* if this is an open type */
407 MonoType **type_argv;
411 * The generic context: an instantiation of a set of class and method generic parameters.
413 * NOTE: Never allocate this directly on the heap. It have to be either allocated on the stack,
414 * or embedded within other objects. Don't store pointers to this, because it may be on the stack.
415 * If you really have to, ensure you store a pointer to the embedding object along with it.
417 struct _MonoGenericContext {
418 /* The instantiation corresponding to the class generic parameters */
419 MonoGenericInst *class_inst;
420 /* The instantiation corresponding to the method generic parameters */
421 MonoGenericInst *method_inst;
425 * Inflated generic method.
427 struct _MonoMethodInflated {
430 MonoMethodNormal normal;
431 MonoMethodPInvoke pinvoke;
433 MonoMethod *declaring; /* the generic method definition. */
434 MonoGenericContext context; /* The current instantiation */
436 /* TODO we MUST get rid of this field, it's an ugly hack nobody is proud of. */
437 guint is_mb_open : 1; /* This is the fully open instantiation of a generic method_builder. Worse than is_tb_open, but it's temporary */
441 * A particular instantiation of a generic type.
443 struct _MonoGenericClass {
444 MonoClass *container_class; /* the generic type definition */
445 MonoGenericContext context; /* a context that contains the type instantiation doesn't contain any method instantiation */
446 guint is_dynamic : 1; /* We're a MonoDynamicGenericClass */
447 guint is_tb_open : 1; /* This is the fully open instantiation for a type_builder. Quite ugly, but it's temporary.*/
448 MonoClass *cached_class; /* if present, the MonoClass corresponding to the instantiation. */
452 * This is used when instantiating a generic type definition which is
455 struct _MonoDynamicGenericClass {
456 MonoGenericClass generic_class;
458 MonoMethod **methods;
462 MonoClassField *fields;
463 int count_properties;
464 MonoProperty *properties;
471 * The generic container.
473 * Stores the type parameters of a generic type definition or a generic method definition.
475 struct _MonoGenericContainer {
476 MonoGenericContext context;
477 /* If we're a generic method definition in a generic type definition,
478 the generic container of the containing class. */
479 MonoGenericContainer *parent;
480 /* the generic type definition or the generic method definition corresponding to this container */
486 /* If true, we're a generic method, otherwise a generic type definition. */
487 /* Invariant: parent != NULL => is_method */
489 /* Our type parameters. */
490 MonoGenericParam *type_params;
496 struct _MonoGenericParam {
497 MonoGenericContainer *owner; /* Type or method this parameter was defined in. */
498 MonoClass *pklass; /* The corresponding `MonoClass'. */
502 MonoClass** constraints; /* NULL means end of list */
503 /* If owner is NULL, this is the image whose mempool this struct was allocated from */
508 * Class information which might be cached by the runtime in the AOT file for
509 * example. Caching this allows us to avoid computing a generic vtable
510 * (class->vtable) in most cases, saving time and avoiding creation of lots of
511 * MonoMethod structures.
513 typedef struct MonoCachedClassInfo {
515 guint has_finalize : 1;
518 guint has_nested_classes : 1;
520 guint has_references : 1;
521 guint has_static_refs : 1;
522 guint no_special_static_fields : 1;
524 MonoImage *finalize_image;
525 guint32 finalize_token;
526 guint32 instance_size;
528 guint32 packing_size;
530 } MonoCachedClassInfo;
535 gconstpointer wrapper;
536 gconstpointer trampoline;
537 MonoMethodSignature *sig;
541 guint8 exception_type;
542 char *class_name; /* If kind == TYPE */
543 char *assembly_name; /* If kind == TYPE or ASSEMBLY */
544 MonoClass *klass; /* If kind != TYPE */
545 const char *member_name; /* If kind != TYPE */
546 gboolean ref_only; /* If kind == ASSEMBLY */
547 char *msg; /* If kind == BAD_IMAGE */
550 #define mono_class_has_parent(klass,parent) (((klass)->idepth >= (parent)->idepth) && ((klass)->supertypes [(parent)->idepth - 1] == (parent)))
553 gulong new_object_count;
554 gulong initialized_class_count;
555 gulong generic_vtable_count;
556 gulong used_class_count;
558 gulong class_vtable_size;
559 gulong class_static_data_size;
560 gulong generic_instance_count;
561 gulong generic_class_count;
562 gulong inflated_method_count;
563 gulong inflated_method_count_2;
564 gulong inflated_type_count;
565 gulong generics_metadata_size;
566 gulong dynamic_code_alloc_count;
567 gulong dynamic_code_bytes_count;
568 gulong dynamic_code_frees_count;
569 gulong delegate_creations;
570 gulong imt_tables_size;
571 gulong imt_number_of_tables;
572 gulong imt_number_of_methods;
573 gulong imt_used_slots;
574 gulong imt_slots_with_collisions;
575 gulong imt_max_collisions_in_slot;
576 gulong imt_method_count_when_max_collisions;
577 gulong imt_thunks_size;
578 gulong jit_info_table_insert_count;
579 gulong jit_info_table_remove_count;
580 gulong jit_info_table_lookup_count;
581 gulong hazardous_pointer_count;
582 gulong generics_sharable_methods;
583 gulong generics_unsharable_methods;
584 gulong generics_shared_methods;
585 gulong minor_gc_count;
586 gulong major_gc_count;
587 gulong minor_gc_time_usecs;
588 gulong major_gc_time_usecs;
593 * new structure to hold performace counters values that are exported
595 * Note: never remove fields from this structure and only add them to the end.
596 * Size of fields and type should not be changed as well.
599 gulong methods_jitted;
600 gulong aspnet_requests_queued;
603 extern MonoPerfCounters *mono_perfcounters MONO_INTERNAL;
605 void mono_perfcounters_init (void);
608 * The definition of the first field in SafeHandle,
609 * Keep in sync with SafeHandle.cs, this is only used
610 * to access the `handle' parameter.
618 * Keep in sync with HandleRef.cs
626 MONO_GENERIC_SHARING_NONE,
627 MONO_GENERIC_SHARING_CORLIB,
628 MONO_GENERIC_SHARING_ALL
632 * Flags for which contexts were used in inflating a generic.
635 MONO_GENERIC_CONTEXT_USED_CLASS = 1,
636 MONO_GENERIC_CONTEXT_USED_METHOD = 2
639 #define MONO_GENERIC_CONTEXT_USED_BOTH (MONO_GENERIC_CONTEXT_USED_CLASS | MONO_GENERIC_CONTEXT_USED_METHOD)
641 extern MonoStats mono_stats MONO_INTERNAL;
643 typedef gpointer (*MonoTrampoline) (MonoMethod *method);
644 typedef gpointer (*MonoJumpTrampoline) (MonoDomain *domain, MonoMethod *method, gboolean add_sync_wrapper);
645 typedef gpointer (*MonoRemotingTrampoline) (MonoMethod *method, MonoRemotingTarget target);
646 typedef gpointer (*MonoDelegateTrampoline) (MonoClass *klass);
648 typedef gpointer (*MonoLookupDynamicToken) (MonoImage *image, guint32 token, gboolean valid_token, MonoClass **handle_class, MonoGenericContext *context);
650 typedef gboolean (*MonoGetCachedClassInfo) (MonoClass *klass, MonoCachedClassInfo *res);
652 typedef gboolean (*MonoGetClassFromName) (MonoImage *image, const char *name_space, const char *name, MonoClass **res);
655 mono_classes_init (void) MONO_INTERNAL;
658 mono_classes_cleanup (void) MONO_INTERNAL;
661 mono_class_layout_fields (MonoClass *klass) MONO_INTERNAL;
664 mono_class_setup_interface_offsets (MonoClass *klass) MONO_INTERNAL;
667 mono_class_setup_vtable_general (MonoClass *klass, MonoMethod **overrides, int onum) MONO_INTERNAL;
670 mono_class_setup_vtable (MonoClass *klass) MONO_INTERNAL;
673 mono_class_setup_methods (MonoClass *klass) MONO_INTERNAL;
676 mono_class_setup_mono_type (MonoClass *klass) MONO_INTERNAL;
679 mono_class_setup_parent (MonoClass *klass, MonoClass *parent) MONO_INTERNAL;
682 mono_class_setup_supertypes (MonoClass *klass) MONO_INTERNAL;
685 mono_class_get_method_by_index (MonoClass *class, int index) MONO_INTERNAL;
688 mono_class_get_implemented_interfaces (MonoClass *klass) MONO_INTERNAL;
691 mono_class_is_open_constructed_type (MonoType *t) MONO_INTERNAL;
694 mono_class_get_overrides_full (MonoImage *image, guint32 type_token, MonoMethod ***overrides, gint32 *num_overrides,
695 MonoGenericContext *generic_context) MONO_INTERNAL;
698 mono_class_get_cctor (MonoClass *klass) MONO_INTERNAL;
701 mono_class_get_finalizer (MonoClass *klass) MONO_INTERNAL;
704 mono_class_needs_cctor_run (MonoClass *klass, MonoMethod *caller) MONO_INTERNAL;
707 mono_class_has_special_static_fields (MonoClass *klass) MONO_INTERNAL;
710 mono_class_get_field_default_value (MonoClassField *field, MonoTypeEnum *def_type) MONO_INTERNAL;
713 mono_install_trampoline (MonoTrampoline func) MONO_INTERNAL;
716 mono_install_jump_trampoline (MonoJumpTrampoline func) MONO_INTERNAL;
719 mono_install_remoting_trampoline (MonoRemotingTrampoline func) MONO_INTERNAL;
722 mono_install_delegate_trampoline (MonoDelegateTrampoline func) MONO_INTERNAL;
725 mono_lookup_dynamic_token (MonoImage *image, guint32 token, MonoGenericContext *context) MONO_INTERNAL;
728 mono_lookup_dynamic_token_class (MonoImage *image, guint32 token, gboolean check_token, MonoClass **handle_class, MonoGenericContext *context) MONO_INTERNAL;
731 mono_install_lookup_dynamic_token (MonoLookupDynamicToken func) MONO_INTERNAL;
734 mono_runtime_create_jump_trampoline (MonoDomain *domain, MonoMethod *method, gboolean add_sync_wrapper) MONO_INTERNAL;
737 mono_runtime_create_delegate_trampoline (MonoClass *klass) MONO_INTERNAL;
740 mono_install_get_cached_class_info (MonoGetCachedClassInfo func) MONO_INTERNAL;
743 mono_install_get_class_from_name (MonoGetClassFromName func) MONO_INTERNAL;
746 mono_class_get_context (MonoClass *class) MONO_INTERNAL;
749 mono_method_get_context (MonoMethod *method) MONO_INTERNAL;
751 /* Used by monodis, thus cannot be MONO_INTERNAL */
752 MonoGenericContainer*
753 mono_method_get_generic_container (MonoMethod *method);
756 mono_generic_class_get_context (MonoGenericClass *gclass) MONO_INTERNAL;
759 mono_generic_class_get_class (MonoGenericClass *gclass) MONO_INTERNAL;
762 mono_method_set_generic_container (MonoMethod *method, MonoGenericContainer* container) MONO_INTERNAL;
765 mono_class_inflate_generic_method_full (MonoMethod *method, MonoClass *klass_hint, MonoGenericContext *context);
768 mono_method_inflated_lookup (MonoMethodInflated* method, gboolean cache) MONO_INTERNAL;
770 MonoMethodSignature *
771 mono_metadata_get_inflated_signature (MonoMethodSignature *sig, MonoGenericContext *context);
774 mono_metadata_free_inflated_signature (MonoMethodSignature *sig);
778 MonoClass *object_class;
779 MonoClass *byte_class;
780 MonoClass *void_class;
781 MonoClass *boolean_class;
782 MonoClass *sbyte_class;
783 MonoClass *int16_class;
784 MonoClass *uint16_class;
785 MonoClass *int32_class;
786 MonoClass *uint32_class;
787 MonoClass *int_class;
788 MonoClass *uint_class;
789 MonoClass *int64_class;
790 MonoClass *uint64_class;
791 MonoClass *single_class;
792 MonoClass *double_class;
793 MonoClass *char_class;
794 MonoClass *string_class;
795 MonoClass *enum_class;
796 MonoClass *array_class;
797 MonoClass *delegate_class;
798 MonoClass *multicastdelegate_class;
799 MonoClass *asyncresult_class;
800 MonoClass *waithandle_class;
801 MonoClass *typehandle_class;
802 MonoClass *fieldhandle_class;
803 MonoClass *methodhandle_class;
804 MonoClass *systemtype_class;
805 MonoClass *monotype_class;
806 MonoClass *exception_class;
807 MonoClass *threadabortexception_class;
808 MonoClass *thread_class;
809 MonoClass *transparent_proxy_class;
810 MonoClass *real_proxy_class;
811 MonoClass *mono_method_message_class;
812 MonoClass *appdomain_class;
813 MonoClass *field_info_class;
814 MonoClass *method_info_class;
815 MonoClass *stringbuilder_class;
816 MonoClass *math_class;
817 MonoClass *stack_frame_class;
818 MonoClass *stack_trace_class;
819 MonoClass *marshal_class;
820 MonoClass *iserializeable_class;
821 MonoClass *serializationinfo_class;
822 MonoClass *streamingcontext_class;
823 MonoClass *typed_reference_class;
824 MonoClass *argumenthandle_class;
825 MonoClass *marshalbyrefobject_class;
826 MonoClass *monitor_class;
827 MonoClass *iremotingtypeinfo_class;
828 MonoClass *runtimesecurityframe_class;
829 MonoClass *executioncontext_class;
830 MonoClass *internals_visible_class;
831 MonoClass *generic_ilist_class;
832 MonoClass *generic_nullable_class;
833 MonoClass *variant_class;
834 MonoClass *com_object_class;
835 MonoClass *com_interop_proxy_class;
836 MonoClass *iunknown_class;
837 MonoClass *idispatch_class;
838 MonoClass *safehandle_class;
839 MonoClass *handleref_class;
840 MonoClass *attribute_class;
841 MonoClass *customattribute_data_class;
844 extern MonoDefaults mono_defaults MONO_INTERNAL;
847 mono_loader_init (void) MONO_INTERNAL;
850 mono_loader_cleanup (void) MONO_INTERNAL;
853 mono_loader_lock (void) MONO_INTERNAL;
856 mono_loader_unlock (void) MONO_INTERNAL;
859 mono_loader_set_error_assembly_load (const char *assembly_name, gboolean ref_only) MONO_INTERNAL;
862 mono_loader_set_error_type_load (const char *class_name, const char *assembly_name) MONO_INTERNAL;
865 mono_loader_set_error_method_load (const char *class_name, const char *member_name) MONO_INTERNAL;
868 mono_loader_set_error_field_load (MonoClass *klass, const char *member_name) MONO_INTERNAL;
870 mono_loader_set_error_bad_image (char *msg) MONO_INTERNAL;
873 mono_loader_error_prepare_exception (MonoLoaderError *error) MONO_INTERNAL;
876 mono_loader_get_last_error (void) MONO_INTERNAL;
879 mono_loader_clear_error (void) MONO_INTERNAL;
882 mono_reflection_init (void) MONO_INTERNAL;
885 mono_icall_init (void) MONO_INTERNAL;
888 mono_icall_cleanup (void) MONO_INTERNAL;
891 mono_method_get_wrapper_data (MonoMethod *method, guint32 id) MONO_INTERNAL;
894 mono_install_stack_walk (MonoStackWalkImpl func) MONO_INTERNAL;
897 mono_metadata_has_generic_params (MonoImage *image, guint32 token) MONO_INTERNAL;
899 MonoGenericContainer *
900 mono_metadata_load_generic_params (MonoImage *image, guint32 token,
901 MonoGenericContainer *parent_container);
904 mono_metadata_load_generic_param_constraints (MonoImage *image, guint32 token,
905 MonoGenericContainer *container);
908 mono_create_icall_signature (const char *sigstr) MONO_INTERNAL;
911 mono_register_jit_icall (gconstpointer func, const char *name, MonoMethodSignature *sig, gboolean is_save) MONO_INTERNAL;
914 mono_register_jit_icall_wrapper (MonoJitICallInfo *info, gconstpointer wrapper) MONO_INTERNAL;
917 mono_find_jit_icall_by_name (const char *name) MONO_INTERNAL;
920 mono_find_jit_icall_by_addr (gconstpointer addr) MONO_INTERNAL;
923 mono_class_set_failure (MonoClass *klass, guint32 ex_type, void *ex_data) MONO_INTERNAL;
926 mono_class_get_exception_data (MonoClass *klass) MONO_INTERNAL;
929 mono_class_get_exception_for_failure (MonoClass *klass) MONO_INTERNAL;
932 mono_type_get_name_full (MonoType *type, MonoTypeNameFormat format) MONO_INTERNAL;
935 mono_type_get_full_name (MonoClass *class) MONO_INTERNAL;
937 MonoArrayType *mono_dup_array_type (MonoArrayType *a) MONO_INTERNAL;
938 MonoMethodSignature *mono_metadata_signature_deep_dup (MonoMethodSignature *sig) MONO_INTERNAL;
941 mono_image_init_name_cache (MonoImage *image);
943 gboolean mono_class_is_nullable (MonoClass *klass) MONO_INTERNAL;
944 MonoClass *mono_class_get_nullable_param (MonoClass *klass) MONO_INTERNAL;
946 /* object debugging functions, for use inside gdb */
947 void mono_object_describe (MonoObject *obj);
948 void mono_object_describe_fields (MonoObject *obj);
949 void mono_value_describe_fields (MonoClass* klass, const char* addr);
950 void mono_class_describe_statics (MonoClass* klass);
952 /*Enum validation related functions*/
954 mono_type_is_valid_enum_basetype (MonoType * type);
957 mono_class_is_valid_enum (MonoClass *klass);
960 mono_type_get_full (MonoImage *image, guint32 type_token, MonoGenericContext *context) MONO_INTERNAL;
963 mono_generic_class_is_generic_type_definition (MonoGenericClass *gklass) MONO_INTERNAL;
966 mono_type_get_basic_type_from_generic (MonoType *type) MONO_INTERNAL;
969 mono_class_generic_sharing_enabled (MonoClass *class) MONO_INTERNAL;
972 mono_class_fill_runtime_generic_context (MonoVTable *class_vtable, guint32 slot) MONO_INTERNAL;
975 mono_class_rgctx_get_array_size (int n) MONO_INTERNAL;
978 mono_class_lookup_or_register_other_info (MonoClass *class, gpointer data, int info_type, MonoGenericContext *generic_context) MONO_INTERNAL;
981 mono_generic_context_check_used (MonoGenericContext *context) MONO_INTERNAL;
984 mono_class_check_context_used (MonoClass *class) MONO_INTERNAL;
987 mono_class_unregister_image_generic_subclasses (MonoImage *image) MONO_INTERNAL;
990 mono_method_can_access_method_full (MonoMethod *method, MonoMethod *called, MonoClass *context_klass) MONO_INTERNAL;
993 mono_method_can_access_field_full (MonoMethod *method, MonoClassField *field, MonoClass *context_klass) MONO_INTERNAL;
995 #endif /* __MONO_METADATA_CLASS_INTERBALS_H__ */