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_DEFAULT_SUPERTABLE_SIZE 6
14 extern gboolean mono_print_vtable;
16 extern gboolean mono_setup_vtable_in_class_init;
18 typedef void (*MonoStackWalkImpl) (MonoStackWalk func, gboolean do_il_offset, gpointer user_data);
20 typedef struct _MonoMethodNormal MonoMethodNormal;
21 typedef struct _MonoMethodWrapper MonoMethodWrapper;
22 typedef struct _MonoMethodInflated MonoMethodInflated;
23 typedef struct _MonoMethodPInvoke MonoMethodPInvoke;
25 /* Properties that applies to a group of structs should better use a higher number
26 * to avoid colision with type specific properties.
28 * This prop applies to class, method, property, event, assembly and image.
30 #define MONO_PROP_DYNAMIC_CATTR 0x1000
33 #define WRAPPER(e,n) MONO_WRAPPER_ ## e,
34 #include "wrapper-types.h"
40 MONO_TYPE_NAME_FORMAT_IL,
41 MONO_TYPE_NAME_FORMAT_REFLECTION,
42 MONO_TYPE_NAME_FORMAT_FULL_NAME,
43 MONO_TYPE_NAME_FORMAT_ASSEMBLY_QUALIFIED
47 MONO_REMOTING_TARGET_UNKNOWN,
48 MONO_REMOTING_TARGET_APPDOMAIN,
49 MONO_REMOTING_TARGET_COMINTEROP
52 #define MONO_METHOD_PROP_GENERIC_CONTAINER 0
55 guint16 flags; /* method flags */
56 guint16 iflags; /* method implementation flags */
59 MonoMethodSignature *signature;
60 /* name is useful mostly for debugging */
62 /* this is used by the inlining algorithm */
63 unsigned int inline_info:1;
64 unsigned int inline_failure:1;
65 unsigned int wrapper_type:5;
66 unsigned int string_ctor:1;
67 unsigned int save_lmf:1;
68 unsigned int dynamic:1; /* created & destroyed during runtime */
69 unsigned int is_generic:1; /* whenever this is a generic method definition */
70 unsigned int is_inflated:1; /* whether we're a MonoMethodInflated */
71 unsigned int skip_visibility:1; /* whenever to skip JIT visibility checks */
72 unsigned int verification_success:1; /* whether this method has been verified successfully.*/
76 * If is_generic is TRUE, the generic_container is stored in image->property_hash,
77 * using the key MONO_METHOD_PROP_GENERIC_CONTAINER.
81 struct _MonoMethodNormal {
83 MonoMethodHeader *header;
86 struct _MonoMethodWrapper {
87 MonoMethodNormal method;
91 struct _MonoMethodPInvoke {
94 /* add marshal info */
95 guint16 piflags; /* pinvoke flags */
96 guint16 implmap_idx; /* index into IMPLMAP */
100 MonoType *generic_type;
101 gpointer reflection_info;
105 * MonoClassField is just a runtime representation of the metadata for
106 * field, it doesn't contain the data directly. Static fields are
107 * stored in MonoVTable->data. Instance fields are allocated in the
108 * objects after the object header.
110 struct _MonoClassField {
111 /* Type of the field */
114 /* If this is an instantiated generic type, this is the
115 * "original" type, ie. the MONO_TYPE_VAR or MONO_TYPE_GENERICINST
116 * it was instantiated from.
118 MonoInflatedField *generic_info;
121 * Offset where this field is stored; if it is an instance
122 * field, it's the offset from the start of the object, if
123 * it's static, it's from the start of the memory chunk
124 * allocated for statics for the class.
131 * If the field is constant, pointer to the metadata constant
133 * If the field has an RVA flag, pointer to the data.
138 /* Type where the field was defined */
142 * If the field is constant, the type of the constant.
144 MonoTypeEnum def_type;
147 /* a field is ignored if it's named "_Deleted" and it has the specialname and rtspecialname flags set */
148 #define mono_field_is_deleted(field) (((field)->type->attrs & (FIELD_ATTRIBUTE_SPECIAL_NAME | FIELD_ATTRIBUTE_RT_SPECIAL_NAME)) \
149 && (strcmp ((field)->name, "_Deleted") == 0))
152 MonoClassField *field;
154 MonoMarshalSpec *mspec;
160 MonoMethod *ptr_to_str;
161 MonoMethod *str_to_ptr;
162 MonoMarshalField fields [MONO_ZERO_LEN_ARRAY];
165 struct _MonoProperty {
183 /* type of exception being "on hold" for later processing (see exception_type) */
185 MONO_EXCEPTION_NONE = 0,
186 MONO_EXCEPTION_SECURITY_LINKDEMAND = 1,
187 MONO_EXCEPTION_SECURITY_INHERITANCEDEMAND = 2,
188 MONO_EXCEPTION_INVALID_PROGRAM = 3,
189 MONO_EXCEPTION_UNVERIFIABLE_IL = 4,
190 MONO_EXCEPTION_MISSING_METHOD = 5,
191 MONO_EXCEPTION_MISSING_FIELD = 6,
192 MONO_EXCEPTION_TYPE_LOAD = 7,
193 MONO_EXCEPTION_FILE_NOT_FOUND = 8,
194 MONO_EXCEPTION_METHOD_ACCESS = 9,
195 MONO_EXCEPTION_FIELD_ACCESS = 10,
196 MONO_EXCEPTION_GENERIC_SHARING_FAILED = 11,
197 MONO_EXCEPTION_BAD_IMAGE = 12
198 /* add other exception type */
201 /* This struct collects the info needed for the runtime use of a class,
202 * like the vtables for a domain, the GC descriptor, etc.
206 /* domain_vtables is indexed by the domain id and the size is max_domain + 1 */
207 MonoVTable *domain_vtables [MONO_ZERO_LEN_ARRAY];
208 } MonoClassRuntimeInfo;
211 MONO_RGCTX_INFO_STATIC_DATA,
212 MONO_RGCTX_INFO_KLASS,
213 MONO_RGCTX_INFO_VTABLE,
214 MONO_RGCTX_INFO_TYPE,
215 MONO_RGCTX_INFO_REFLECTION_TYPE,
216 MONO_RGCTX_INFO_METHOD,
217 MONO_RGCTX_INFO_GENERIC_METHOD_CODE,
218 MONO_RGCTX_INFO_CLASS_FIELD
221 typedef struct _MonoRuntimeGenericContextOtherInfoTemplate {
224 struct _MonoRuntimeGenericContextOtherInfoTemplate *next;
225 } MonoRuntimeGenericContextOtherInfoTemplate;
228 MonoClass *next_subclass;
229 MonoRuntimeGenericContextOtherInfoTemplate *other_infos;
230 } MonoRuntimeGenericContextTemplate;
232 #define MONO_CLASS_PROP_EXCEPTION_DATA 0
235 /* element class for arrays and enum */
236 MonoClass *element_class;
237 /* used for subtype checks */
238 MonoClass *cast_class;
240 /* for fast subtype checks */
241 MonoClass **supertypes;
244 /* array dimension */
247 int instance_size; /* object instance size */
250 /* We use init_pending to detect cyclic calls to mono_class_init */
251 guint init_pending : 1;
253 /* A class contains static and non static data. Static data can be
254 * of the same type as the class itselfs, but it does not influence
255 * the instance size of the class. To avoid cyclic calls to
256 * mono_class_init (from mono_class_instance_size ()) we first
257 * initialise all non static fields. After that we set size_inited
258 * to 1, because we know the instance size now. After that we
259 * initialise all static fields.
261 guint size_inited : 1;
262 guint valuetype : 1; /* derives from System.ValueType */
263 guint enumtype : 1; /* derives from System.Enum */
264 guint blittable : 1; /* class is blittable */
265 guint unicode : 1; /* class uses unicode char when marshalled */
266 guint wastypebuilder : 1; /* class was created at runtime from a TypeBuilder */
269 guint packing_size : 4;
271 guint ghcimpl : 1; /* class has its own GetHashCode impl */
272 guint has_finalize : 1; /* class has its own Finalize impl */
273 guint marshalbyref : 1; /* class is a MarshalByRefObject */
274 guint contextbound : 1; /* class is a ContextBoundObject */
275 guint delegate : 1; /* class is a Delegate */
276 guint gc_descr_inited : 1; /* gc_descr is initialized */
277 guint has_cctor : 1; /* class has a cctor */
278 guint has_references : 1; /* it has GC-tracked references in the instance */
280 guint has_static_refs : 1; /* it has static fields that are GC-tracked */
281 guint no_special_static_fields : 1; /* has no thread/context static fields */
282 /* directly or indirectly derives from ComImport attributed class.
283 * this means we need to create a proxy for instances of this class
284 * for COM Interop. set this flag on loading so all we need is a quick check
285 * during object creation rather than having to traverse supertypes
287 guint is_com_object : 1;
289 guint8 exception_type; /* MONO_EXCEPTION_* */
291 /* Additional information about the exception */
292 /* Stored as property MONO_CLASS_PROP_EXCEPTION_DATA */
293 //void *exception_data;
296 MonoClass *nested_in;
297 GList *nested_classes;
301 const char *name_space;
303 /* The underlying type of the enum */
304 MonoType *enum_basetype;
306 guint32 declsec_flags; /* declarative security attributes flags */
308 int vtable_size; /* number of slots */
310 guint16 interface_count;
311 guint16 interface_id; /* unique inderface id (for interfaces) */
312 guint16 max_interface_id;
314 guint16 interface_offsets_count;
315 MonoClass **interfaces_packed;
316 guint16 *interface_offsets_packed;
317 guint8 *interface_bitmap;
319 MonoClass **interfaces;
322 int class_size; /* size of area for static fields */
323 int element_size; /* for array types */
324 int generic_param_token; /* for generic param types, both var and mvar */
328 * From the TypeDef table
332 guint32 first, count;
333 } field, method, property, event;
335 /* loaded on demand */
336 MonoMarshalType *marshal_info;
339 * Field information: Type and location from object base
341 MonoClassField *fields;
343 /* Initialized by a call to mono_class_setup_properties () */
344 MonoProperty *properties;
346 /* Initialized by a call to mono_class_setup_events () */
349 MonoMethod **methods;
351 /* used as the type of the this argument and when passing the arg by value */
355 MonoGenericClass *generic_class;
356 MonoGenericContainer *generic_container;
358 void *reflection_info;
362 MonoClassRuntimeInfo *runtime_info;
364 /* next element in the class_cache hash list (in MonoImage) */
365 MonoClass *next_class_cache;
367 /* Generic vtable. Initialized by a call to mono_class_setup_vtable () */
371 #define MONO_CLASS_IMPLEMENTS_INTERFACE(k,uiid) (((uiid) <= (k)->max_interface_id) && ((k)->interface_bitmap [(uiid) >> 3] & (1 << ((uiid)&7))))
372 int mono_class_interface_offset (MonoClass *klass, MonoClass *itf);
374 typedef gpointer MonoRuntimeGenericContext;
376 /* the interface_offsets array is stored in memory before this struct */
380 * According to comments in gc_gcj.h, this should be the second word in
384 MonoDomain *domain; /* each object/vtable belongs to exactly one domain */
385 gpointer data; /* to store static class data */
386 gpointer type; /* System.Type type for klass */
387 guint8 *interface_bitmap;
388 guint16 max_interface_id;
390 guint remote : 1; /* class is remotely activated */
391 guint initialized : 1; /* cctor has been run */
392 guint init_failed : 1; /* cctor execution failed */
393 guint32 imt_collisions_bitmap;
394 MonoRuntimeGenericContext *runtime_generic_context;
395 /* do not add any fields after vtable, the structure is dynamically extended */
396 gpointer vtable [MONO_ZERO_LEN_ARRAY];
399 #define MONO_VTABLE_IMPLEMENTS_INTERFACE(vt,uiid) (((uiid) <= (vt)->max_interface_id) && ((vt)->interface_bitmap [(uiid) >> 3] & (1 << ((uiid)&7))))
402 * Generic instantiation data type encoding.
406 * A particular generic instantiation:
408 * All instantiations are cached and we don't distinguish between class and method
409 * instantiations here.
411 struct _MonoGenericInst {
412 guint id; /* unique ID for debugging */
413 guint type_argc : 22; /* number of type arguments */
414 guint is_open : 1; /* if this is an open type */
415 MonoType **type_argv;
419 * The generic context: an instantiation of a set of class and method generic parameters.
421 * NOTE: Never allocate this directly on the heap. It have to be either allocated on the stack,
422 * or embedded within other objects. Don't store pointers to this, because it may be on the stack.
423 * If you really have to, ensure you store a pointer to the embedding object along with it.
425 struct _MonoGenericContext {
426 /* The instantiation corresponding to the class generic parameters */
427 MonoGenericInst *class_inst;
428 /* The instantiation corresponding to the method generic parameters */
429 MonoGenericInst *method_inst;
433 * Inflated generic method.
435 struct _MonoMethodInflated {
438 MonoMethodNormal normal;
439 MonoMethodPInvoke pinvoke;
441 MonoMethod *declaring; /* the generic method definition. */
442 MonoGenericContext context; /* The current instantiation */
444 /* TODO we MUST get rid of this field, it's an ugly hack nobody is proud of. */
445 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 */
449 * A particular instantiation of a generic type.
451 struct _MonoGenericClass {
452 MonoClass *container_class; /* the generic type definition */
453 MonoGenericContext context; /* a context that contains the type instantiation doesn't contain any method instantiation */
454 guint is_dynamic : 1; /* We're a MonoDynamicGenericClass */
455 guint is_tb_open : 1; /* This is the fully open instantiation for a type_builder. Quite ugly, but it's temporary.*/
456 MonoClass *cached_class; /* if present, the MonoClass corresponding to the instantiation. */
460 * This is used when instantiating a generic type definition which is
463 struct _MonoDynamicGenericClass {
464 MonoGenericClass generic_class;
466 MonoMethod **methods;
470 MonoClassField *fields;
471 int count_properties;
472 MonoProperty *properties;
479 * The generic container.
481 * Stores the type parameters of a generic type definition or a generic method definition.
483 struct _MonoGenericContainer {
484 MonoGenericContext context;
485 /* If we're a generic method definition in a generic type definition,
486 the generic container of the containing class. */
487 MonoGenericContainer *parent;
488 /* the generic type definition or the generic method definition corresponding to this container */
494 /* If true, we're a generic method, otherwise a generic type definition. */
495 /* Invariant: parent != NULL => is_method */
497 /* Our type parameters. */
498 MonoGenericParam *type_params;
504 struct _MonoGenericParam {
505 MonoGenericContainer *owner; /* Type or method this parameter was defined in. */
506 MonoClass *pklass; /* The corresponding `MonoClass'. */
510 MonoClass** constraints; /* NULL means end of list */
511 /* If owner is NULL, this is the image whose mempool this struct was allocated from */
516 * Class information which might be cached by the runtime in the AOT file for
517 * example. Caching this allows us to avoid computing a generic vtable
518 * (class->vtable) in most cases, saving time and avoiding creation of lots of
519 * MonoMethod structures.
521 typedef struct MonoCachedClassInfo {
523 guint has_finalize : 1;
526 guint has_nested_classes : 1;
528 guint has_references : 1;
529 guint has_static_refs : 1;
530 guint no_special_static_fields : 1;
532 MonoImage *finalize_image;
533 guint32 finalize_token;
534 guint32 instance_size;
536 guint32 packing_size;
538 } MonoCachedClassInfo;
543 gconstpointer wrapper;
544 gconstpointer trampoline;
545 MonoMethodSignature *sig;
549 guint8 exception_type;
550 char *class_name; /* If kind == TYPE */
551 char *assembly_name; /* If kind == TYPE or ASSEMBLY */
552 MonoClass *klass; /* If kind != TYPE */
553 const char *member_name; /* If kind != TYPE */
554 gboolean ref_only; /* If kind == ASSEMBLY */
555 char *msg; /* If kind == BAD_IMAGE */
558 #define mono_class_has_parent(klass,parent) (((klass)->idepth >= (parent)->idepth) && ((klass)->supertypes [(parent)->idepth - 1] == (parent)))
561 gulong new_object_count;
562 gulong initialized_class_count;
563 gulong generic_vtable_count;
564 gulong used_class_count;
566 gulong class_vtable_size;
567 gulong class_static_data_size;
568 gulong generic_instance_count;
569 gulong generic_class_count;
570 gulong inflated_method_count;
571 gulong inflated_method_count_2;
572 gulong inflated_type_count;
573 gulong generics_metadata_size;
574 gulong dynamic_code_alloc_count;
575 gulong dynamic_code_bytes_count;
576 gulong dynamic_code_frees_count;
577 gulong delegate_creations;
578 gulong imt_tables_size;
579 gulong imt_number_of_tables;
580 gulong imt_number_of_methods;
581 gulong imt_used_slots;
582 gulong imt_slots_with_collisions;
583 gulong imt_max_collisions_in_slot;
584 gulong imt_method_count_when_max_collisions;
585 gulong imt_thunks_size;
586 gulong jit_info_table_insert_count;
587 gulong jit_info_table_remove_count;
588 gulong jit_info_table_lookup_count;
589 gulong hazardous_pointer_count;
590 gulong generics_sharable_methods;
591 gulong generics_unsharable_methods;
592 gulong generics_shared_methods;
593 gulong minor_gc_count;
594 gulong major_gc_count;
595 gulong minor_gc_time_usecs;
596 gulong major_gc_time_usecs;
601 * new structure to hold performace counters values that are exported
603 * Note: never remove fields from this structure and only add them to the end.
604 * Size of fields and type should not be changed as well.
607 gulong methods_jitted;
608 gulong aspnet_requests_queued;
611 extern MonoPerfCounters *mono_perfcounters MONO_INTERNAL;
613 void mono_perfcounters_init (void);
616 * The definition of the first field in SafeHandle,
617 * Keep in sync with SafeHandle.cs, this is only used
618 * to access the `handle' parameter.
626 * Keep in sync with HandleRef.cs
634 MONO_GENERIC_SHARING_NONE,
635 MONO_GENERIC_SHARING_CORLIB,
636 MONO_GENERIC_SHARING_ALL
640 * Flags for which contexts were used in inflating a generic.
643 MONO_GENERIC_CONTEXT_USED_CLASS = 1,
644 MONO_GENERIC_CONTEXT_USED_METHOD = 2
647 #define MONO_GENERIC_CONTEXT_USED_BOTH (MONO_GENERIC_CONTEXT_USED_CLASS | MONO_GENERIC_CONTEXT_USED_METHOD)
649 extern MonoStats mono_stats MONO_INTERNAL;
651 typedef gpointer (*MonoTrampoline) (MonoMethod *method);
652 typedef gpointer (*MonoJumpTrampoline) (MonoDomain *domain, MonoMethod *method, gboolean add_sync_wrapper);
653 typedef gpointer (*MonoRemotingTrampoline) (MonoMethod *method, MonoRemotingTarget target);
654 typedef gpointer (*MonoDelegateTrampoline) (MonoClass *klass);
656 typedef gpointer (*MonoLookupDynamicToken) (MonoImage *image, guint32 token, gboolean valid_token, MonoClass **handle_class, MonoGenericContext *context);
658 typedef gboolean (*MonoGetCachedClassInfo) (MonoClass *klass, MonoCachedClassInfo *res);
660 typedef gboolean (*MonoGetClassFromName) (MonoImage *image, const char *name_space, const char *name, MonoClass **res);
663 mono_classes_init (void) MONO_INTERNAL;
666 mono_classes_cleanup (void) MONO_INTERNAL;
669 mono_class_layout_fields (MonoClass *klass) MONO_INTERNAL;
672 mono_class_setup_interface_offsets (MonoClass *klass) MONO_INTERNAL;
675 mono_class_setup_vtable_general (MonoClass *klass, MonoMethod **overrides, int onum) MONO_INTERNAL;
678 mono_class_setup_vtable (MonoClass *klass) MONO_INTERNAL;
681 mono_class_setup_methods (MonoClass *klass) MONO_INTERNAL;
684 mono_class_setup_mono_type (MonoClass *klass) MONO_INTERNAL;
687 mono_class_setup_parent (MonoClass *klass, MonoClass *parent) MONO_INTERNAL;
690 mono_class_setup_supertypes (MonoClass *klass) MONO_INTERNAL;
693 mono_class_get_method_by_index (MonoClass *class, int index) MONO_INTERNAL;
696 mono_class_get_implemented_interfaces (MonoClass *klass) MONO_INTERNAL;
699 mono_class_is_open_constructed_type (MonoType *t) MONO_INTERNAL;
702 mono_class_get_overrides_full (MonoImage *image, guint32 type_token, MonoMethod ***overrides, gint32 *num_overrides,
703 MonoGenericContext *generic_context) MONO_INTERNAL;
706 mono_class_get_cctor (MonoClass *klass) MONO_INTERNAL;
709 mono_class_get_finalizer (MonoClass *klass) MONO_INTERNAL;
712 mono_class_needs_cctor_run (MonoClass *klass, MonoMethod *caller) MONO_INTERNAL;
715 mono_class_has_special_static_fields (MonoClass *klass) MONO_INTERNAL;
718 mono_class_get_field_default_value (MonoClassField *field, MonoTypeEnum *def_type) MONO_INTERNAL;
721 mono_install_trampoline (MonoTrampoline func) MONO_INTERNAL;
724 mono_install_jump_trampoline (MonoJumpTrampoline func) MONO_INTERNAL;
727 mono_install_remoting_trampoline (MonoRemotingTrampoline func) MONO_INTERNAL;
730 mono_install_delegate_trampoline (MonoDelegateTrampoline func) MONO_INTERNAL;
733 mono_lookup_dynamic_token (MonoImage *image, guint32 token, MonoGenericContext *context) MONO_INTERNAL;
736 mono_lookup_dynamic_token_class (MonoImage *image, guint32 token, gboolean check_token, MonoClass **handle_class, MonoGenericContext *context) MONO_INTERNAL;
739 mono_install_lookup_dynamic_token (MonoLookupDynamicToken func) MONO_INTERNAL;
742 mono_runtime_create_jump_trampoline (MonoDomain *domain, MonoMethod *method, gboolean add_sync_wrapper) MONO_INTERNAL;
745 mono_runtime_create_delegate_trampoline (MonoClass *klass) MONO_INTERNAL;
748 mono_install_get_cached_class_info (MonoGetCachedClassInfo func) MONO_INTERNAL;
751 mono_install_get_class_from_name (MonoGetClassFromName func) MONO_INTERNAL;
754 mono_class_get_context (MonoClass *class) MONO_INTERNAL;
757 mono_method_get_context (MonoMethod *method) MONO_INTERNAL;
759 /* Used by monodis, thus cannot be MONO_INTERNAL */
760 MonoGenericContainer*
761 mono_method_get_generic_container (MonoMethod *method);
764 mono_generic_class_get_context (MonoGenericClass *gclass) MONO_INTERNAL;
767 mono_generic_class_get_class (MonoGenericClass *gclass) MONO_INTERNAL;
770 mono_method_set_generic_container (MonoMethod *method, MonoGenericContainer* container) MONO_INTERNAL;
773 mono_class_inflate_generic_method_full (MonoMethod *method, MonoClass *klass_hint, MonoGenericContext *context);
776 mono_method_inflated_lookup (MonoMethodInflated* method, gboolean cache) MONO_INTERNAL;
778 MonoMethodSignature *
779 mono_metadata_get_inflated_signature (MonoMethodSignature *sig, MonoGenericContext *context);
782 mono_metadata_free_inflated_signature (MonoMethodSignature *sig);
786 MonoClass *object_class;
787 MonoClass *byte_class;
788 MonoClass *void_class;
789 MonoClass *boolean_class;
790 MonoClass *sbyte_class;
791 MonoClass *int16_class;
792 MonoClass *uint16_class;
793 MonoClass *int32_class;
794 MonoClass *uint32_class;
795 MonoClass *int_class;
796 MonoClass *uint_class;
797 MonoClass *int64_class;
798 MonoClass *uint64_class;
799 MonoClass *single_class;
800 MonoClass *double_class;
801 MonoClass *char_class;
802 MonoClass *string_class;
803 MonoClass *enum_class;
804 MonoClass *array_class;
805 MonoClass *delegate_class;
806 MonoClass *multicastdelegate_class;
807 MonoClass *asyncresult_class;
808 MonoClass *waithandle_class;
809 MonoClass *typehandle_class;
810 MonoClass *fieldhandle_class;
811 MonoClass *methodhandle_class;
812 MonoClass *systemtype_class;
813 MonoClass *monotype_class;
814 MonoClass *exception_class;
815 MonoClass *threadabortexception_class;
816 MonoClass *thread_class;
817 MonoClass *transparent_proxy_class;
818 MonoClass *real_proxy_class;
819 MonoClass *mono_method_message_class;
820 MonoClass *appdomain_class;
821 MonoClass *field_info_class;
822 MonoClass *method_info_class;
823 MonoClass *stringbuilder_class;
824 MonoClass *math_class;
825 MonoClass *stack_frame_class;
826 MonoClass *stack_trace_class;
827 MonoClass *marshal_class;
828 MonoClass *iserializeable_class;
829 MonoClass *serializationinfo_class;
830 MonoClass *streamingcontext_class;
831 MonoClass *typed_reference_class;
832 MonoClass *argumenthandle_class;
833 MonoClass *marshalbyrefobject_class;
834 MonoClass *monitor_class;
835 MonoClass *iremotingtypeinfo_class;
836 MonoClass *runtimesecurityframe_class;
837 MonoClass *executioncontext_class;
838 MonoClass *internals_visible_class;
839 MonoClass *generic_ilist_class;
840 MonoClass *generic_nullable_class;
841 MonoClass *variant_class;
842 MonoClass *com_object_class;
843 MonoClass *com_interop_proxy_class;
844 MonoClass *iunknown_class;
845 MonoClass *idispatch_class;
846 MonoClass *safehandle_class;
847 MonoClass *handleref_class;
848 MonoClass *attribute_class;
849 MonoClass *customattribute_data_class;
852 extern MonoDefaults mono_defaults MONO_INTERNAL;
855 mono_loader_init (void) MONO_INTERNAL;
858 mono_loader_cleanup (void) MONO_INTERNAL;
861 mono_loader_lock (void) MONO_INTERNAL;
864 mono_loader_unlock (void) MONO_INTERNAL;
867 mono_loader_set_error_assembly_load (const char *assembly_name, gboolean ref_only) MONO_INTERNAL;
870 mono_loader_set_error_type_load (const char *class_name, const char *assembly_name) MONO_INTERNAL;
873 mono_loader_set_error_method_load (const char *class_name, const char *member_name) MONO_INTERNAL;
876 mono_loader_set_error_field_load (MonoClass *klass, const char *member_name) MONO_INTERNAL;
878 mono_loader_set_error_bad_image (char *msg) MONO_INTERNAL;
881 mono_loader_error_prepare_exception (MonoLoaderError *error) MONO_INTERNAL;
884 mono_loader_get_last_error (void) MONO_INTERNAL;
887 mono_loader_clear_error (void) MONO_INTERNAL;
890 mono_reflection_init (void) MONO_INTERNAL;
893 mono_icall_init (void) MONO_INTERNAL;
896 mono_icall_cleanup (void) MONO_INTERNAL;
899 mono_method_get_wrapper_data (MonoMethod *method, guint32 id) MONO_INTERNAL;
902 mono_install_stack_walk (MonoStackWalkImpl func) MONO_INTERNAL;
905 mono_metadata_has_generic_params (MonoImage *image, guint32 token) MONO_INTERNAL;
907 MonoGenericContainer *
908 mono_metadata_load_generic_params (MonoImage *image, guint32 token,
909 MonoGenericContainer *parent_container);
912 mono_metadata_load_generic_param_constraints (MonoImage *image, guint32 token,
913 MonoGenericContainer *container);
916 mono_create_icall_signature (const char *sigstr) MONO_INTERNAL;
919 mono_register_jit_icall (gconstpointer func, const char *name, MonoMethodSignature *sig, gboolean is_save) MONO_INTERNAL;
922 mono_register_jit_icall_wrapper (MonoJitICallInfo *info, gconstpointer wrapper) MONO_INTERNAL;
925 mono_find_jit_icall_by_name (const char *name) MONO_INTERNAL;
928 mono_find_jit_icall_by_addr (gconstpointer addr) MONO_INTERNAL;
931 mono_class_set_failure (MonoClass *klass, guint32 ex_type, void *ex_data) MONO_INTERNAL;
934 mono_class_get_exception_data (MonoClass *klass) MONO_INTERNAL;
937 mono_class_get_exception_for_failure (MonoClass *klass) MONO_INTERNAL;
940 mono_type_get_name_full (MonoType *type, MonoTypeNameFormat format) MONO_INTERNAL;
943 mono_type_get_full_name (MonoClass *class) MONO_INTERNAL;
945 MonoArrayType *mono_dup_array_type (MonoMemPool *mp, MonoArrayType *a) MONO_INTERNAL;
946 MonoMethodSignature *mono_metadata_signature_deep_dup (MonoMemPool *mp, MonoMethodSignature *sig) MONO_INTERNAL;
949 mono_image_init_name_cache (MonoImage *image);
951 gboolean mono_class_is_nullable (MonoClass *klass) MONO_INTERNAL;
952 MonoClass *mono_class_get_nullable_param (MonoClass *klass) MONO_INTERNAL;
954 /* object debugging functions, for use inside gdb */
955 void mono_object_describe (MonoObject *obj);
956 void mono_object_describe_fields (MonoObject *obj);
957 void mono_value_describe_fields (MonoClass* klass, const char* addr);
958 void mono_class_describe_statics (MonoClass* klass);
960 /*Enum validation related functions*/
962 mono_type_is_valid_enum_basetype (MonoType * type);
965 mono_class_is_valid_enum (MonoClass *klass);
968 mono_type_get_full (MonoImage *image, guint32 type_token, MonoGenericContext *context) MONO_INTERNAL;
971 mono_generic_class_is_generic_type_definition (MonoGenericClass *gklass) MONO_INTERNAL;
974 mono_type_get_basic_type_from_generic (MonoType *type) MONO_INTERNAL;
977 mono_class_generic_sharing_enabled (MonoClass *class) MONO_INTERNAL;
980 mono_class_fill_runtime_generic_context (MonoVTable *class_vtable, guint32 slot) MONO_INTERNAL;
983 mono_class_rgctx_get_array_size (int n) MONO_INTERNAL;
986 mono_class_lookup_or_register_other_info (MonoClass *class, gpointer data, int info_type, MonoGenericContext *generic_context) MONO_INTERNAL;
989 mono_generic_context_check_used (MonoGenericContext *context) MONO_INTERNAL;
992 mono_class_check_context_used (MonoClass *class) MONO_INTERNAL;
995 mono_class_unregister_image_generic_subclasses (MonoImage *image) MONO_INTERNAL;
998 mono_method_can_access_method_full (MonoMethod *method, MonoMethod *called, MonoClass *context_klass) MONO_INTERNAL;
1001 mono_method_can_access_field_full (MonoMethod *method, MonoClassField *field, MonoClass *context_klass) MONO_INTERNAL;
1003 #endif /* __MONO_METADATA_CLASS_INTERBALS_H__ */