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 typedef void (*MonoStackWalkImpl) (MonoStackWalk func, gboolean do_il_offset, gpointer user_data);
17 typedef struct _MonoMethodNormal MonoMethodNormal;
18 typedef struct _MonoMethodWrapper MonoMethodWrapper;
19 typedef struct _MonoMethodInflated MonoMethodInflated;
20 typedef struct _MonoMethodPInvoke MonoMethodPInvoke;
23 #define WRAPPER(e,n) MONO_WRAPPER_ ## e,
24 #include "wrapper-types.h"
30 MONO_TYPE_NAME_FORMAT_IL,
31 MONO_TYPE_NAME_FORMAT_REFLECTION,
32 MONO_TYPE_NAME_FORMAT_FULL_NAME,
33 MONO_TYPE_NAME_FORMAT_ASSEMBLY_QUALIFIED
37 MONO_REMOTING_TARGET_UNKNOWN,
38 MONO_REMOTING_TARGET_APPDOMAIN,
39 MONO_REMOTING_TARGET_COMINTEROP
43 guint16 flags; /* method flags */
44 guint16 iflags; /* method implementation flags */
47 MonoMethodSignature *signature;
48 MonoGenericContainer *generic_container;
49 /* name is useful mostly for debugging */
51 /* this is used by the inlining algorithm */
52 unsigned int inline_info:1;
53 unsigned int inline_failure:1;
54 unsigned int wrapper_type:5;
55 unsigned int string_ctor:1;
56 unsigned int save_lmf:1;
57 unsigned int dynamic:1; /* created & destroyed during runtime */
58 unsigned int is_inflated:1; /* whether we're a MonoMethodInflated */
59 unsigned int skip_visibility:1; /* whenever to skip JIT visibility checks */
60 unsigned int verification_success:1; /* whether this method has been verified successfully.*/
64 struct _MonoMethodNormal {
66 MonoMethodHeader *header;
69 struct _MonoMethodWrapper {
70 MonoMethodNormal method;
74 struct _MonoMethodPInvoke {
77 /* add marshal info */
78 guint16 piflags; /* pinvoke flags */
79 guint16 implmap_idx; /* index into IMPLMAP */
83 MonoType *generic_type;
84 gpointer reflection_info;
88 * MonoClassField is just a runtime representation of the metadata for
89 * field, it doesn't contain the data directly. Static fields are
90 * stored in MonoVTable->data. Instance fields are allocated in the
91 * objects after the object header.
93 struct _MonoClassField {
94 /* Type of the field */
97 /* If this is an instantiated generic type, this is the
98 * "original" type, ie. the MONO_TYPE_VAR or MONO_TYPE_GENERICINST
99 * it was instantiated from.
101 MonoInflatedField *generic_info;
104 * Offset where this field is stored; if it is an instance
105 * field, it's the offset from the start of the object, if
106 * it's static, it's from the start of the memory chunk
107 * allocated for statics for the class.
114 * If the field is constant, pointer to the metadata constant
116 * If the field has an RVA flag, pointer to the data.
121 /* Type where the field was defined */
125 * If the field is constant, the type of the constant.
127 MonoTypeEnum def_type;
130 /* a field is ignored if it's named "_Deleted" and it has the specialname and rtspecialname flags set */
131 #define mono_field_is_deleted(field) (((field)->type->attrs & (FIELD_ATTRIBUTE_SPECIAL_NAME | FIELD_ATTRIBUTE_RT_SPECIAL_NAME)) \
132 && (strcmp ((field)->name, "_Deleted") == 0))
135 MonoClassField *field;
137 MonoMarshalSpec *mspec;
143 MonoMethod *ptr_to_str;
144 MonoMethod *str_to_ptr;
145 MonoMarshalField fields [MONO_ZERO_LEN_ARRAY];
148 struct _MonoProperty {
166 /* type of exception being "on hold" for later processing (see exception_type) */
168 MONO_EXCEPTION_NONE = 0,
169 MONO_EXCEPTION_SECURITY_LINKDEMAND = 1,
170 MONO_EXCEPTION_SECURITY_INHERITANCEDEMAND = 2,
171 MONO_EXCEPTION_INVALID_PROGRAM = 3,
172 MONO_EXCEPTION_UNVERIFIABLE_IL = 4,
173 MONO_EXCEPTION_MISSING_METHOD = 5,
174 MONO_EXCEPTION_MISSING_FIELD = 6,
175 MONO_EXCEPTION_TYPE_LOAD = 7,
176 MONO_EXCEPTION_FILE_NOT_FOUND = 8,
177 MONO_EXCEPTION_METHOD_ACCESS = 9,
178 MONO_EXCEPTION_FIELD_ACCESS = 10,
179 MONO_EXCEPTION_GENERIC_SHARING_FAILED = 11,
180 MONO_EXCEPTION_BAD_IMAGE = 12
181 /* add other exception type */
184 /* This struct collects the info needed for the runtime use of a class,
185 * like the vtables for a domain, the GC descriptor, etc.
189 /* domain_vtables is indexed by the domain id and the size is max_domain + 1 */
190 MonoVTable *domain_vtables [MONO_ZERO_LEN_ARRAY];
191 } MonoClassRuntimeInfo;
194 MONO_RGCTX_INFO_STATIC_DATA,
195 MONO_RGCTX_INFO_KLASS,
196 MONO_RGCTX_INFO_VTABLE,
197 MONO_RGCTX_INFO_TYPE,
198 MONO_RGCTX_INFO_REFLECTION_TYPE,
199 MONO_RGCTX_INFO_METHOD,
200 MONO_RGCTX_INFO_GENERIC_METHOD_CODE,
201 MONO_RGCTX_INFO_CLASS_FIELD
204 typedef struct _MonoRuntimeGenericContextOtherInfoTemplate {
207 struct _MonoRuntimeGenericContextOtherInfoTemplate *next;
208 } MonoRuntimeGenericContextOtherInfoTemplate;
211 MonoClass *next_subclass;
212 MonoRuntimeGenericContextOtherInfoTemplate *other_infos;
213 } MonoRuntimeGenericContextTemplate;
216 /* element class for arrays and enum */
217 MonoClass *element_class;
218 /* used for subtype checks */
219 MonoClass *cast_class;
221 /* for fast subtype checks */
222 MonoClass **supertypes;
225 /* array dimension */
228 int instance_size; /* object instance size */
231 /* We use init_pending to detect cyclic calls to mono_class_init */
232 guint init_pending : 1;
234 /* A class contains static and non static data. Static data can be
235 * of the same type as the class itselfs, but it does not influence
236 * the instance size of the class. To avoid cyclic calls to
237 * mono_class_init (from mono_class_instance_size ()) we first
238 * initialise all non static fields. After that we set size_inited
239 * to 1, because we know the instance size now. After that we
240 * initialise all static fields.
242 guint size_inited : 1;
243 guint valuetype : 1; /* derives from System.ValueType */
244 guint enumtype : 1; /* derives from System.Enum */
245 guint blittable : 1; /* class is blittable */
246 guint unicode : 1; /* class uses unicode char when marshalled */
247 guint wastypebuilder : 1; /* class was created at runtime from a TypeBuilder */
250 guint packing_size : 4;
252 guint ghcimpl : 1; /* class has its own GetHashCode impl */
253 guint has_finalize : 1; /* class has its own Finalize impl */
254 guint marshalbyref : 1; /* class is a MarshalByRefObject */
255 guint contextbound : 1; /* class is a ContextBoundObject */
256 guint delegate : 1; /* class is a Delegate */
257 guint gc_descr_inited : 1; /* gc_descr is initialized */
258 guint has_cctor : 1; /* class has a cctor */
259 guint has_references : 1; /* it has GC-tracked references in the instance */
261 guint has_static_refs : 1; /* it has static fields that are GC-tracked */
262 guint no_special_static_fields : 1; /* has no thread/context static fields */
263 /* directly or indirectly derives from ComImport attributed class.
264 * this means we need to create a proxy for instances of this class
265 * for COM Interop. set this flag on loading so all we need is a quick check
266 * during object creation rather than having to traverse supertypes
268 guint is_com_object : 1;
270 guint8 exception_type; /* MONO_EXCEPTION_* */
271 void* exception_data; /* Additional information about the exception */
274 MonoClass *nested_in;
275 GList *nested_classes;
279 const char *name_space;
281 /* The underlying type of the enum */
282 MonoType *enum_basetype;
284 guint32 declsec_flags; /* declarative security attributes flags */
286 int vtable_size; /* number of slots */
288 guint16 interface_count;
289 guint16 interface_id; /* unique inderface id (for interfaces) */
290 guint16 max_interface_id;
292 guint16 interface_offsets_count;
293 MonoClass **interfaces_packed;
294 guint16 *interface_offsets_packed;
295 guint8 *interface_bitmap;
297 MonoClass **interfaces;
300 int class_size; /* size of area for static fields */
301 int element_size; /* for array types */
302 int generic_param_token; /* for generic param types, both var and mvar */
306 * From the TypeDef table
310 guint32 first, count;
311 } field, method, property, event;
313 /* loaded on demand */
314 MonoMarshalType *marshal_info;
317 * Field information: Type and location from object base
319 MonoClassField *fields;
321 /* Initialized by a call to mono_class_setup_properties () */
322 MonoProperty *properties;
324 /* Initialized by a call to mono_class_setup_events () */
327 MonoMethod **methods;
329 /* used as the type of the this argument and when passing the arg by value */
333 MonoGenericClass *generic_class;
334 MonoGenericContainer *generic_container;
336 void *reflection_info;
340 MonoClassRuntimeInfo *runtime_info;
342 /* next element in the class_cache hash list (in MonoImage) */
343 MonoClass *next_class_cache;
345 /* Generic vtable. Initialized by a call to mono_class_setup_vtable () */
349 #define MONO_CLASS_IMPLEMENTS_INTERFACE(k,uiid) (((uiid) <= (k)->max_interface_id) && ((k)->interface_bitmap [(uiid) >> 3] & (1 << ((uiid)&7))))
350 int mono_class_interface_offset (MonoClass *klass, MonoClass *itf);
352 typedef gpointer MonoRuntimeGenericContext;
354 /* the interface_offsets array is stored in memory before this struct */
358 * According to comments in gc_gcj.h, this should be the second word in
362 MonoDomain *domain; /* each object/vtable belongs to exactly one domain */
363 gpointer data; /* to store static class data */
364 gpointer type; /* System.Type type for klass */
365 guint8 *interface_bitmap;
366 guint16 max_interface_id;
368 guint remote : 1; /* class is remotely activated */
369 guint initialized : 1; /* cctor has been run */
370 guint init_failed : 1; /* cctor execution failed */
371 guint32 imt_collisions_bitmap;
372 MonoRuntimeGenericContext *runtime_generic_context;
373 /* do not add any fields after vtable, the structure is dynamically extended */
374 gpointer vtable [MONO_ZERO_LEN_ARRAY];
377 #define MONO_VTABLE_IMPLEMENTS_INTERFACE(vt,uiid) (((uiid) <= (vt)->max_interface_id) && ((vt)->interface_bitmap [(uiid) >> 3] & (1 << ((uiid)&7))))
380 * Generic instantiation data type encoding.
384 * A particular generic instantiation:
386 * All instantiations are cached and we don't distinguish between class and method
387 * instantiations here.
389 struct _MonoGenericInst {
390 guint id; /* unique ID for debugging */
391 guint type_argc : 22; /* number of type arguments */
392 guint is_open : 1; /* if this is an open type */
393 MonoType **type_argv;
397 * The generic context: an instantiation of a set of class and method generic parameters.
399 * NOTE: Never allocate this directly on the heap. It have to be either allocated on the stack,
400 * or embedded within other objects. Don't store pointers to this, because it may be on the stack.
401 * If you really have to, ensure you store a pointer to the embedding object along with it.
403 struct _MonoGenericContext {
404 /* The instantiation corresponding to the class generic parameters */
405 MonoGenericInst *class_inst;
406 /* The instantiation corresponding to the method generic parameters */
407 MonoGenericInst *method_inst;
411 * Inflated generic method.
413 struct _MonoMethodInflated {
416 MonoMethodNormal normal;
417 MonoMethodPInvoke pinvoke;
419 MonoMethod *declaring; /* the generic method definition. */
420 MonoGenericContext context; /* The current instantiation */
422 /* TODO we MUST get rid of this field, it's an ugly hack nobody is proud of. */
423 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 */
427 * A particular instantiation of a generic type.
429 struct _MonoGenericClass {
430 MonoClass *container_class; /* the generic type definition */
431 MonoGenericContext context; /* a context that contains the type instantiation doesn't contain any method instantiation */
432 guint is_dynamic : 1; /* We're a MonoDynamicGenericClass */
433 guint is_tb_open : 1; /* This is the fully open instantiation for a type_builder. Quite ugly, but it's temporary.*/
434 MonoClass *cached_class; /* if present, the MonoClass corresponding to the instantiation. */
438 * This is used when instantiating a generic type definition which is
441 struct _MonoDynamicGenericClass {
442 MonoGenericClass generic_class;
444 MonoMethod **methods;
448 MonoClassField *fields;
449 int count_properties;
450 MonoProperty *properties;
457 * The generic container.
459 * Stores the type parameters of a generic type definition or a generic method definition.
461 struct _MonoGenericContainer {
462 MonoGenericContext context;
463 /* If we're a generic method definition in a generic type definition,
464 the generic container of the containing class. */
465 MonoGenericContainer *parent;
466 /* the generic type definition or the generic method definition corresponding to this container */
472 /* If true, we're a generic method, otherwise a generic type definition. */
473 /* Invariant: parent != NULL => is_method */
475 /* Our type parameters. */
476 MonoGenericParam *type_params;
482 struct _MonoGenericParam {
483 MonoGenericContainer *owner; /* Type or method this parameter was defined in. */
484 MonoClass *pklass; /* The corresponding `MonoClass'. */
488 MonoClass** constraints; /* NULL means end of list */
489 /* If owner is NULL, this is the image whose mempool this struct was allocated from */
494 * Class information which might be cached by the runtime in the AOT file for
495 * example. Caching this allows us to avoid computing a generic vtable
496 * (class->vtable) in most cases, saving time and avoiding creation of lots of
497 * MonoMethod structures.
499 typedef struct MonoCachedClassInfo {
501 guint has_finalize : 1;
504 guint has_nested_classes : 1;
506 guint has_references : 1;
507 guint has_static_refs : 1;
508 guint no_special_static_fields : 1;
510 MonoImage *finalize_image;
511 guint32 finalize_token;
512 guint32 instance_size;
514 guint32 packing_size;
516 } MonoCachedClassInfo;
521 gconstpointer wrapper;
522 gconstpointer trampoline;
523 MonoMethodSignature *sig;
527 guint8 exception_type;
528 char *class_name; /* If kind == TYPE */
529 char *assembly_name; /* If kind == TYPE or ASSEMBLY */
530 MonoClass *klass; /* If kind != TYPE */
531 const char *member_name; /* If kind != TYPE */
532 gboolean ref_only; /* If kind == ASSEMBLY */
533 char *msg; /* If kind == BAD_IMAGE */
536 #define mono_class_has_parent(klass,parent) (((klass)->idepth >= (parent)->idepth) && ((klass)->supertypes [(parent)->idepth - 1] == (parent)))
539 gulong new_object_count;
540 gulong initialized_class_count;
541 gulong generic_vtable_count;
542 gulong used_class_count;
544 gulong class_vtable_size;
545 gulong class_static_data_size;
546 gulong generic_instance_count;
547 gulong generic_class_count;
548 gulong inflated_method_count;
549 gulong inflated_method_count_2;
550 gulong inflated_type_count;
551 gulong generics_metadata_size;
552 gulong dynamic_code_alloc_count;
553 gulong dynamic_code_bytes_count;
554 gulong dynamic_code_frees_count;
555 gulong delegate_creations;
556 gulong imt_tables_size;
557 gulong imt_number_of_tables;
558 gulong imt_number_of_methods;
559 gulong imt_used_slots;
560 gulong imt_slots_with_collisions;
561 gulong imt_max_collisions_in_slot;
562 gulong imt_method_count_when_max_collisions;
563 gulong imt_thunks_size;
564 gulong jit_info_table_insert_count;
565 gulong jit_info_table_remove_count;
566 gulong jit_info_table_lookup_count;
567 gulong hazardous_pointer_count;
568 gulong generics_sharable_methods;
569 gulong generics_unsharable_methods;
570 gulong generics_shared_methods;
571 gulong minor_gc_count;
572 gulong major_gc_count;
573 gulong minor_gc_time_usecs;
574 gulong major_gc_time_usecs;
579 * new structure to hold performace counters values that are exported
581 * Note: never remove fields from this structure and only add them to the end.
582 * Size of fields and type should not be changed as well.
585 gulong methods_jitted;
586 gulong aspnet_requests_queued;
589 extern MonoPerfCounters *mono_perfcounters MONO_INTERNAL;
591 void mono_perfcounters_init (void);
594 * The definition of the first field in SafeHandle,
595 * Keep in sync with SafeHandle.cs, this is only used
596 * to access the `handle' parameter.
604 * Keep in sync with HandleRef.cs
612 MONO_GENERIC_SHARING_NONE,
613 MONO_GENERIC_SHARING_CORLIB,
614 MONO_GENERIC_SHARING_ALL
618 * Flags for which contexts were used in inflating a generic.
621 MONO_GENERIC_CONTEXT_USED_CLASS = 1,
622 MONO_GENERIC_CONTEXT_USED_METHOD = 2
625 #define MONO_GENERIC_CONTEXT_USED_BOTH (MONO_GENERIC_CONTEXT_USED_CLASS | MONO_GENERIC_CONTEXT_USED_METHOD)
627 extern MonoStats mono_stats MONO_INTERNAL;
629 typedef gpointer (*MonoTrampoline) (MonoMethod *method);
630 typedef gpointer (*MonoJumpTrampoline) (MonoDomain *domain, MonoMethod *method, gboolean add_sync_wrapper);
631 typedef gpointer (*MonoRemotingTrampoline) (MonoMethod *method, MonoRemotingTarget target);
632 typedef gpointer (*MonoDelegateTrampoline) (MonoClass *klass);
634 typedef gpointer (*MonoLookupDynamicToken) (MonoImage *image, guint32 token, gboolean valid_token, MonoClass **handle_class, MonoGenericContext *context);
636 typedef gboolean (*MonoGetCachedClassInfo) (MonoClass *klass, MonoCachedClassInfo *res);
638 typedef gboolean (*MonoGetClassFromName) (MonoImage *image, const char *name_space, const char *name, MonoClass **res);
641 mono_classes_init (void) MONO_INTERNAL;
644 mono_classes_cleanup (void) MONO_INTERNAL;
647 mono_class_layout_fields (MonoClass *klass) MONO_INTERNAL;
650 mono_class_setup_interface_offsets (MonoClass *klass) MONO_INTERNAL;
653 mono_class_setup_vtable_general (MonoClass *klass, MonoMethod **overrides, int onum) MONO_INTERNAL;
656 mono_class_setup_vtable (MonoClass *klass) MONO_INTERNAL;
659 mono_class_setup_methods (MonoClass *klass) MONO_INTERNAL;
662 mono_class_setup_mono_type (MonoClass *klass) MONO_INTERNAL;
665 mono_class_setup_parent (MonoClass *klass, MonoClass *parent) MONO_INTERNAL;
668 mono_class_setup_supertypes (MonoClass *klass) MONO_INTERNAL;
671 mono_class_get_method_by_index (MonoClass *class, int index) MONO_INTERNAL;
674 mono_class_get_implemented_interfaces (MonoClass *klass) MONO_INTERNAL;
677 mono_class_is_open_constructed_type (MonoType *t) MONO_INTERNAL;
680 mono_class_get_overrides_full (MonoImage *image, guint32 type_token, MonoMethod ***overrides, gint32 *num_overrides,
681 MonoGenericContext *generic_context) MONO_INTERNAL;
684 mono_class_get_cctor (MonoClass *klass) MONO_INTERNAL;
687 mono_class_get_finalizer (MonoClass *klass) MONO_INTERNAL;
690 mono_class_needs_cctor_run (MonoClass *klass, MonoMethod *caller) MONO_INTERNAL;
693 mono_class_has_special_static_fields (MonoClass *klass) MONO_INTERNAL;
696 mono_class_get_field_default_value (MonoClassField *field, MonoTypeEnum *def_type) MONO_INTERNAL;
699 mono_install_trampoline (MonoTrampoline func) MONO_INTERNAL;
702 mono_install_jump_trampoline (MonoJumpTrampoline func) MONO_INTERNAL;
705 mono_install_remoting_trampoline (MonoRemotingTrampoline func) MONO_INTERNAL;
708 mono_install_delegate_trampoline (MonoDelegateTrampoline func) MONO_INTERNAL;
711 mono_lookup_dynamic_token (MonoImage *image, guint32 token, MonoGenericContext *context) MONO_INTERNAL;
714 mono_lookup_dynamic_token_class (MonoImage *image, guint32 token, gboolean check_token, MonoClass **handle_class, MonoGenericContext *context) MONO_INTERNAL;
717 mono_install_lookup_dynamic_token (MonoLookupDynamicToken func) MONO_INTERNAL;
720 mono_runtime_create_jump_trampoline (MonoDomain *domain, MonoMethod *method, gboolean add_sync_wrapper) MONO_INTERNAL;
723 mono_runtime_create_delegate_trampoline (MonoClass *klass) MONO_INTERNAL;
726 mono_install_get_cached_class_info (MonoGetCachedClassInfo func) MONO_INTERNAL;
729 mono_install_get_class_from_name (MonoGetClassFromName func) MONO_INTERNAL;
732 mono_class_get_context (MonoClass *class) MONO_INTERNAL;
735 mono_method_get_context (MonoMethod *method) MONO_INTERNAL;
738 mono_generic_class_get_context (MonoGenericClass *gclass) MONO_INTERNAL;
741 mono_generic_class_get_class (MonoGenericClass *gclass) MONO_INTERNAL;
744 mono_class_inflate_generic_method_full (MonoMethod *method, MonoClass *klass_hint, MonoGenericContext *context);
747 mono_method_inflated_lookup (MonoMethodInflated* method, gboolean cache) MONO_INTERNAL;
749 MonoMethodSignature *
750 mono_metadata_get_inflated_signature (MonoMethodSignature *sig, MonoGenericContext *context);
753 mono_metadata_free_inflated_signature (MonoMethodSignature *sig);
757 MonoClass *object_class;
758 MonoClass *byte_class;
759 MonoClass *void_class;
760 MonoClass *boolean_class;
761 MonoClass *sbyte_class;
762 MonoClass *int16_class;
763 MonoClass *uint16_class;
764 MonoClass *int32_class;
765 MonoClass *uint32_class;
766 MonoClass *int_class;
767 MonoClass *uint_class;
768 MonoClass *int64_class;
769 MonoClass *uint64_class;
770 MonoClass *single_class;
771 MonoClass *double_class;
772 MonoClass *char_class;
773 MonoClass *string_class;
774 MonoClass *enum_class;
775 MonoClass *array_class;
776 MonoClass *delegate_class;
777 MonoClass *multicastdelegate_class;
778 MonoClass *asyncresult_class;
779 MonoClass *waithandle_class;
780 MonoClass *typehandle_class;
781 MonoClass *fieldhandle_class;
782 MonoClass *methodhandle_class;
783 MonoClass *systemtype_class;
784 MonoClass *monotype_class;
785 MonoClass *exception_class;
786 MonoClass *threadabortexception_class;
787 MonoClass *thread_class;
788 MonoClass *transparent_proxy_class;
789 MonoClass *real_proxy_class;
790 MonoClass *mono_method_message_class;
791 MonoClass *appdomain_class;
792 MonoClass *field_info_class;
793 MonoClass *method_info_class;
794 MonoClass *stringbuilder_class;
795 MonoClass *math_class;
796 MonoClass *stack_frame_class;
797 MonoClass *stack_trace_class;
798 MonoClass *marshal_class;
799 MonoClass *iserializeable_class;
800 MonoClass *serializationinfo_class;
801 MonoClass *streamingcontext_class;
802 MonoClass *typed_reference_class;
803 MonoClass *argumenthandle_class;
804 MonoClass *marshalbyrefobject_class;
805 MonoClass *monitor_class;
806 MonoClass *iremotingtypeinfo_class;
807 MonoClass *runtimesecurityframe_class;
808 MonoClass *executioncontext_class;
809 MonoClass *internals_visible_class;
810 MonoClass *generic_ilist_class;
811 MonoClass *generic_nullable_class;
812 MonoClass *variant_class;
813 MonoClass *com_object_class;
814 MonoClass *com_interop_proxy_class;
815 MonoClass *iunknown_class;
816 MonoClass *idispatch_class;
817 MonoClass *safehandle_class;
818 MonoClass *handleref_class;
819 MonoClass *attribute_class;
820 MonoClass *customattribute_data_class;
823 extern MonoDefaults mono_defaults MONO_INTERNAL;
826 mono_loader_init (void) MONO_INTERNAL;
829 mono_loader_cleanup (void) MONO_INTERNAL;
832 mono_loader_lock (void) MONO_INTERNAL;
835 mono_loader_unlock (void) MONO_INTERNAL;
838 mono_loader_set_error_assembly_load (const char *assembly_name, gboolean ref_only) MONO_INTERNAL;
841 mono_loader_set_error_type_load (const char *class_name, const char *assembly_name) MONO_INTERNAL;
844 mono_loader_set_error_method_load (const char *class_name, const char *member_name) MONO_INTERNAL;
847 mono_loader_set_error_field_load (MonoClass *klass, const char *member_name) MONO_INTERNAL;
849 mono_loader_set_error_bad_image (char *msg) MONO_INTERNAL;
852 mono_loader_error_prepare_exception (MonoLoaderError *error) MONO_INTERNAL;
855 mono_loader_get_last_error (void) MONO_INTERNAL;
858 mono_loader_clear_error (void) MONO_INTERNAL;
861 mono_reflection_init (void) MONO_INTERNAL;
864 mono_icall_init (void) MONO_INTERNAL;
867 mono_icall_cleanup (void) MONO_INTERNAL;
870 mono_method_get_wrapper_data (MonoMethod *method, guint32 id) MONO_INTERNAL;
873 mono_install_stack_walk (MonoStackWalkImpl func) MONO_INTERNAL;
876 mono_metadata_has_generic_params (MonoImage *image, guint32 token) MONO_INTERNAL;
878 MonoGenericContainer *
879 mono_metadata_load_generic_params (MonoImage *image, guint32 token,
880 MonoGenericContainer *parent_container);
883 mono_metadata_load_generic_param_constraints (MonoImage *image, guint32 token,
884 MonoGenericContainer *container);
887 mono_create_icall_signature (const char *sigstr) MONO_INTERNAL;
890 mono_register_jit_icall (gconstpointer func, const char *name, MonoMethodSignature *sig, gboolean is_save) MONO_INTERNAL;
893 mono_register_jit_icall_wrapper (MonoJitICallInfo *info, gconstpointer wrapper) MONO_INTERNAL;
896 mono_find_jit_icall_by_name (const char *name) MONO_INTERNAL;
899 mono_find_jit_icall_by_addr (gconstpointer addr) MONO_INTERNAL;
902 mono_class_set_failure (MonoClass *klass, guint32 ex_type, void *ex_data) MONO_INTERNAL;
905 mono_class_get_exception_for_failure (MonoClass *klass) MONO_INTERNAL;
908 mono_type_get_name_full (MonoType *type, MonoTypeNameFormat format) MONO_INTERNAL;
911 mono_type_get_full_name (MonoClass *class) MONO_INTERNAL;
913 MonoArrayType *mono_dup_array_type (MonoArrayType *a) MONO_INTERNAL;
914 MonoMethodSignature *mono_metadata_signature_deep_dup (MonoMethodSignature *sig) MONO_INTERNAL;
917 mono_image_init_name_cache (MonoImage *image);
919 gboolean mono_class_is_nullable (MonoClass *klass) MONO_INTERNAL;
920 MonoClass *mono_class_get_nullable_param (MonoClass *klass) MONO_INTERNAL;
922 /* object debugging functions, for use inside gdb */
923 void mono_object_describe (MonoObject *obj);
924 void mono_object_describe_fields (MonoObject *obj);
925 void mono_value_describe_fields (MonoClass* klass, const char* addr);
926 void mono_class_describe_statics (MonoClass* klass);
928 /*Enum validation related functions*/
930 mono_type_is_valid_enum_basetype (MonoType * type);
933 mono_class_is_valid_enum (MonoClass *klass);
936 mono_type_get_full (MonoImage *image, guint32 type_token, MonoGenericContext *context) MONO_INTERNAL;
939 mono_generic_class_is_generic_type_definition (MonoGenericClass *gklass) MONO_INTERNAL;
942 mono_type_get_basic_type_from_generic (MonoType *type) MONO_INTERNAL;
945 mono_class_generic_sharing_enabled (MonoClass *class) MONO_INTERNAL;
948 mono_class_fill_runtime_generic_context (MonoVTable *class_vtable, guint32 slot) MONO_INTERNAL;
951 mono_class_rgctx_get_array_size (int n) MONO_INTERNAL;
954 mono_class_lookup_or_register_other_info (MonoClass *class, gpointer data, int info_type, MonoGenericContext *generic_context) MONO_INTERNAL;
957 mono_generic_context_check_used (MonoGenericContext *context) MONO_INTERNAL;
960 mono_class_check_context_used (MonoClass *class) MONO_INTERNAL;
963 mono_class_unregister_image_generic_subclasses (MonoImage *image) MONO_INTERNAL;
966 mono_method_can_access_method_full (MonoMethod *method, MonoMethod *called, MonoClass *context_klass) MONO_INTERNAL;
969 mono_method_can_access_field_full (MonoMethod *method, MonoClassField *field, MonoClass *context_klass) MONO_INTERNAL;
971 #endif /* __MONO_METADATA_CLASS_INTERBALS_H__ */