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 MONO_EXCEPTION_OBJECT_SUPPLIED = 13 /*The exception object is already created.*/
199 /* add other exception type */
202 /* This struct collects the info needed for the runtime use of a class,
203 * like the vtables for a domain, the GC descriptor, etc.
207 /* domain_vtables is indexed by the domain id and the size is max_domain + 1 */
208 MonoVTable *domain_vtables [MONO_ZERO_LEN_ARRAY];
209 } MonoClassRuntimeInfo;
212 MONO_RGCTX_INFO_STATIC_DATA,
213 MONO_RGCTX_INFO_KLASS,
214 MONO_RGCTX_INFO_VTABLE,
215 MONO_RGCTX_INFO_TYPE,
216 MONO_RGCTX_INFO_REFLECTION_TYPE,
217 MONO_RGCTX_INFO_METHOD,
218 MONO_RGCTX_INFO_GENERIC_METHOD_CODE,
219 MONO_RGCTX_INFO_CLASS_FIELD,
220 MONO_RGCTX_INFO_METHOD_RGCTX
223 typedef struct _MonoRuntimeGenericContextOtherInfoTemplate {
226 struct _MonoRuntimeGenericContextOtherInfoTemplate *next;
227 } MonoRuntimeGenericContextOtherInfoTemplate;
230 MonoClass *next_subclass;
231 MonoRuntimeGenericContextOtherInfoTemplate *other_infos;
232 GSList *method_templates;
233 } MonoRuntimeGenericContextTemplate;
236 MonoVTable *class_vtable; /* must be the first element */
237 MonoGenericInst *method_inst;
238 gpointer infos [MONO_ZERO_LEN_ARRAY];
239 } MonoMethodRuntimeGenericContext;
241 #define MONO_RGCTX_SLOT_MAKE_RGCTX(i) (i)
242 #define MONO_RGCTX_SLOT_MAKE_MRGCTX(i) ((i) | 0x80000000)
243 #define MONO_RGCTX_SLOT_INDEX(s) ((s) & 0x7fffffff)
244 #define MONO_RGCTX_SLOT_IS_MRGCTX(s) (((s) & 0x80000000) ? TRUE : FALSE)
247 #define MONO_CLASS_PROP_EXCEPTION_DATA 0
250 /* element class for arrays and enum */
251 MonoClass *element_class;
252 /* used for subtype checks */
253 MonoClass *cast_class;
255 /* for fast subtype checks */
256 MonoClass **supertypes;
259 /* array dimension */
262 int instance_size; /* object instance size */
265 /* We use init_pending to detect cyclic calls to mono_class_init */
266 guint init_pending : 1;
268 /* A class contains static and non static data. Static data can be
269 * of the same type as the class itselfs, but it does not influence
270 * the instance size of the class. To avoid cyclic calls to
271 * mono_class_init (from mono_class_instance_size ()) we first
272 * initialise all non static fields. After that we set size_inited
273 * to 1, because we know the instance size now. After that we
274 * initialise all static fields.
276 guint size_inited : 1;
277 guint valuetype : 1; /* derives from System.ValueType */
278 guint enumtype : 1; /* derives from System.Enum */
279 guint blittable : 1; /* class is blittable */
280 guint unicode : 1; /* class uses unicode char when marshalled */
281 guint wastypebuilder : 1; /* class was created at runtime from a TypeBuilder */
284 guint packing_size : 4;
286 guint ghcimpl : 1; /* class has its own GetHashCode impl */
287 guint has_finalize : 1; /* class has its own Finalize impl */
288 guint marshalbyref : 1; /* class is a MarshalByRefObject */
289 guint contextbound : 1; /* class is a ContextBoundObject */
290 guint delegate : 1; /* class is a Delegate */
291 guint gc_descr_inited : 1; /* gc_descr is initialized */
292 guint has_cctor : 1; /* class has a cctor */
293 guint has_references : 1; /* it has GC-tracked references in the instance */
295 guint has_static_refs : 1; /* it has static fields that are GC-tracked */
296 guint no_special_static_fields : 1; /* has no thread/context static fields */
297 /* directly or indirectly derives from ComImport attributed class.
298 * this means we need to create a proxy for instances of this class
299 * for COM Interop. set this flag on loading so all we need is a quick check
300 * during object creation rather than having to traverse supertypes
302 guint is_com_object : 1;
303 guint nested_classes_inited : 1; /* Whenever nested_class is initialized */
305 guint8 exception_type; /* MONO_EXCEPTION_* */
307 /* Additional information about the exception */
308 /* Stored as property MONO_CLASS_PROP_EXCEPTION_DATA */
309 //void *exception_data;
312 MonoClass *nested_in;
313 GList *nested_classes;
317 const char *name_space;
319 /* The underlying type of the enum */
320 MonoType *enum_basetype;
322 guint32 declsec_flags; /* declarative security attributes flags */
324 int vtable_size; /* number of slots */
326 guint16 interface_count;
327 guint16 interface_id; /* unique inderface id (for interfaces) */
328 guint16 max_interface_id;
330 guint16 interface_offsets_count;
331 MonoClass **interfaces_packed;
332 guint16 *interface_offsets_packed;
333 guint8 *interface_bitmap;
335 MonoClass **interfaces;
338 int class_size; /* size of area for static fields */
339 int element_size; /* for array types */
340 int generic_param_token; /* for generic param types, both var and mvar */
344 * From the TypeDef table
348 guint32 first, count;
349 } field, method, property, event;
351 /* loaded on demand */
352 MonoMarshalType *marshal_info;
355 * Field information: Type and location from object base
357 MonoClassField *fields;
359 /* Initialized by a call to mono_class_setup_properties () */
360 MonoProperty *properties;
362 /* Initialized by a call to mono_class_setup_events () */
365 MonoMethod **methods;
367 /* used as the type of the this argument and when passing the arg by value */
371 MonoGenericClass *generic_class;
372 MonoGenericContainer *generic_container;
374 void *reflection_info;
378 MonoClassRuntimeInfo *runtime_info;
380 /* next element in the class_cache hash list (in MonoImage) */
381 MonoClass *next_class_cache;
383 /* Generic vtable. Initialized by a call to mono_class_setup_vtable () */
387 #define MONO_CLASS_IMPLEMENTS_INTERFACE(k,uiid) (((uiid) <= (k)->max_interface_id) && ((k)->interface_bitmap [(uiid) >> 3] & (1 << ((uiid)&7))))
388 int mono_class_interface_offset (MonoClass *klass, MonoClass *itf);
390 typedef gpointer MonoRuntimeGenericContext;
392 /* the interface_offsets array is stored in memory before this struct */
396 * According to comments in gc_gcj.h, this should be the second word in
400 MonoDomain *domain; /* each object/vtable belongs to exactly one domain */
401 gpointer data; /* to store static class data */
402 gpointer type; /* System.Type type for klass */
403 guint8 *interface_bitmap;
404 guint16 max_interface_id;
406 guint remote : 1; /* class is remotely activated */
407 guint initialized : 1; /* cctor has been run */
408 guint init_failed : 1; /* cctor execution failed */
409 guint32 imt_collisions_bitmap;
410 MonoRuntimeGenericContext *runtime_generic_context;
411 /* do not add any fields after vtable, the structure is dynamically extended */
412 gpointer vtable [MONO_ZERO_LEN_ARRAY];
415 #define MONO_VTABLE_IMPLEMENTS_INTERFACE(vt,uiid) (((uiid) <= (vt)->max_interface_id) && ((vt)->interface_bitmap [(uiid) >> 3] & (1 << ((uiid)&7))))
418 * Generic instantiation data type encoding.
422 * A particular generic instantiation:
424 * All instantiations are cached and we don't distinguish between class and method
425 * instantiations here.
427 struct _MonoGenericInst {
428 guint id; /* unique ID for debugging */
429 guint type_argc : 22; /* number of type arguments */
430 guint is_open : 1; /* if this is an open type */
431 MonoType **type_argv;
435 * The generic context: an instantiation of a set of class and method generic parameters.
437 * NOTE: Never allocate this directly on the heap. It have to be either allocated on the stack,
438 * or embedded within other objects. Don't store pointers to this, because it may be on the stack.
439 * If you really have to, ensure you store a pointer to the embedding object along with it.
441 struct _MonoGenericContext {
442 /* The instantiation corresponding to the class generic parameters */
443 MonoGenericInst *class_inst;
444 /* The instantiation corresponding to the method generic parameters */
445 MonoGenericInst *method_inst;
449 * Inflated generic method.
451 struct _MonoMethodInflated {
454 MonoMethodNormal normal;
455 MonoMethodPInvoke pinvoke;
457 MonoMethod *declaring; /* the generic method definition. */
458 MonoGenericContext context; /* The current instantiation */
460 /* TODO we MUST get rid of this field, it's an ugly hack nobody is proud of. */
461 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 */
465 * A particular instantiation of a generic type.
467 struct _MonoGenericClass {
468 MonoClass *container_class; /* the generic type definition */
469 MonoGenericContext context; /* a context that contains the type instantiation doesn't contain any method instantiation */
470 guint is_dynamic : 1; /* We're a MonoDynamicGenericClass */
471 guint is_tb_open : 1; /* This is the fully open instantiation for a type_builder. Quite ugly, but it's temporary.*/
472 MonoClass *cached_class; /* if present, the MonoClass corresponding to the instantiation. */
476 * This is used when instantiating a generic type definition which is
479 struct _MonoDynamicGenericClass {
480 MonoGenericClass generic_class;
482 MonoMethod **methods;
486 MonoClassField *fields;
487 int count_properties;
488 MonoProperty *properties;
495 * The generic container.
497 * Stores the type parameters of a generic type definition or a generic method definition.
499 struct _MonoGenericContainer {
500 MonoGenericContext context;
501 /* If we're a generic method definition in a generic type definition,
502 the generic container of the containing class. */
503 MonoGenericContainer *parent;
504 /* the generic type definition or the generic method definition corresponding to this container */
510 /* If true, we're a generic method, otherwise a generic type definition. */
511 /* Invariant: parent != NULL => is_method */
513 /* Our type parameters. */
514 MonoGenericParam *type_params;
520 struct _MonoGenericParam {
521 MonoGenericContainer *owner; /* Type or method this parameter was defined in. */
522 MonoClass *pklass; /* The corresponding `MonoClass'. */
526 MonoClass** constraints; /* NULL means end of list */
527 /* If owner is NULL, this is the image whose mempool this struct was allocated from */
532 * Class information which might be cached by the runtime in the AOT file for
533 * example. Caching this allows us to avoid computing a generic vtable
534 * (class->vtable) in most cases, saving time and avoiding creation of lots of
535 * MonoMethod structures.
537 typedef struct MonoCachedClassInfo {
539 guint has_finalize : 1;
542 guint has_nested_classes : 1;
544 guint has_references : 1;
545 guint has_static_refs : 1;
546 guint no_special_static_fields : 1;
548 MonoImage *finalize_image;
549 guint32 finalize_token;
550 guint32 instance_size;
552 guint32 packing_size;
554 } MonoCachedClassInfo;
559 gconstpointer wrapper;
560 gconstpointer trampoline;
561 MonoMethodSignature *sig;
565 guint8 exception_type;
566 char *class_name; /* If kind == TYPE */
567 char *assembly_name; /* If kind == TYPE or ASSEMBLY */
568 MonoClass *klass; /* If kind != TYPE */
569 const char *member_name; /* If kind != TYPE */
570 gboolean ref_only; /* If kind == ASSEMBLY */
571 char *msg; /* If kind == BAD_IMAGE */
574 #define mono_class_has_parent(klass,parent) (((klass)->idepth >= (parent)->idepth) && ((klass)->supertypes [(parent)->idepth - 1] == (parent)))
577 gulong new_object_count;
578 gulong initialized_class_count;
579 gulong generic_vtable_count;
580 gulong used_class_count;
582 gulong class_vtable_size;
583 gulong class_static_data_size;
584 gulong generic_instance_count;
585 gulong generic_class_count;
586 gulong inflated_method_count;
587 gulong inflated_method_count_2;
588 gulong inflated_type_count;
589 gulong generics_metadata_size;
590 gulong dynamic_code_alloc_count;
591 gulong dynamic_code_bytes_count;
592 gulong dynamic_code_frees_count;
593 gulong delegate_creations;
594 gulong imt_tables_size;
595 gulong imt_number_of_tables;
596 gulong imt_number_of_methods;
597 gulong imt_used_slots;
598 gulong imt_slots_with_collisions;
599 gulong imt_max_collisions_in_slot;
600 gulong imt_method_count_when_max_collisions;
601 gulong imt_thunks_size;
602 gulong jit_info_table_insert_count;
603 gulong jit_info_table_remove_count;
604 gulong jit_info_table_lookup_count;
605 gulong hazardous_pointer_count;
606 gulong generics_sharable_methods;
607 gulong generics_unsharable_methods;
608 gulong generics_shared_methods;
609 gulong minor_gc_count;
610 gulong major_gc_count;
611 gulong minor_gc_time_usecs;
612 gulong major_gc_time_usecs;
617 * new structure to hold performace counters values that are exported
619 * Note: never remove fields from this structure and only add them to the end.
620 * Size of fields and type should not be changed as well.
627 guint32 jit_failures;
628 /* Exceptions category */
629 guint32 exceptions_thrown;
630 guint32 exceptions_filters;
631 guint32 exceptions_finallys;
632 guint32 exceptions_depth;
633 guint32 aspnet_requests_queued;
634 /* Memory category */
635 guint32 gc_collections0;
636 guint32 gc_collections1;
637 guint32 gc_collections2;
638 guint32 gc_promotions0;
639 guint32 gc_promotions1;
640 guint32 gc_promotion_finalizers;
645 guint32 gc_fin_survivors;
646 guint32 gc_num_handles;
647 guint32 gc_allocated;
650 guint32 gc_total_bytes;
651 guint32 gc_committed_bytes;
652 guint32 gc_reserved_bytes;
653 guint32 gc_num_pinned;
654 guint32 gc_sync_blocks;
655 /* Remoting category */
656 guint32 remoting_calls;
657 guint32 remoting_channels;
658 guint32 remoting_proxies;
659 guint32 remoting_classes;
660 guint32 remoting_objects;
661 guint32 remoting_contexts;
662 /* Loader category */
663 guint32 loader_classes;
664 guint32 loader_total_classes;
665 guint32 loader_appdomains;
666 guint32 loader_total_appdomains;
667 guint32 loader_assemblies;
668 guint32 loader_total_assemblies;
669 guint32 loader_failures;
670 guint32 loader_bytes;
671 guint32 loader_appdomains_uloaded;
672 /* Threads and Locks category */
673 guint32 thread_contentions;
674 guint32 thread_queue_len;
675 guint32 thread_queue_max;
676 guint32 thread_num_logical;
677 guint32 thread_num_physical;
678 guint32 thread_cur_recognized;
679 guint32 thread_num_recognized;
680 /* Interop category */
681 guint32 interop_num_ccw;
682 guint32 interop_num_stubs;
683 guint32 interop_num_marshals;
684 /* Security category */
685 guint32 security_num_checks;
686 guint32 security_num_link_checks;
687 guint32 security_time;
688 guint32 security_depth;
692 extern MonoPerfCounters *mono_perfcounters MONO_INTERNAL;
694 void mono_perfcounters_init (void);
697 * The definition of the first field in SafeHandle,
698 * Keep in sync with SafeHandle.cs, this is only used
699 * to access the `handle' parameter.
707 * Keep in sync with HandleRef.cs
715 MONO_GENERIC_SHARING_NONE,
716 MONO_GENERIC_SHARING_COLLECTIONS,
717 MONO_GENERIC_SHARING_CORLIB,
718 MONO_GENERIC_SHARING_ALL
722 * Flags for which contexts were used in inflating a generic.
725 MONO_GENERIC_CONTEXT_USED_CLASS = 1,
726 MONO_GENERIC_CONTEXT_USED_METHOD = 2
729 #define MONO_GENERIC_CONTEXT_USED_BOTH (MONO_GENERIC_CONTEXT_USED_CLASS | MONO_GENERIC_CONTEXT_USED_METHOD)
731 extern MonoStats mono_stats MONO_INTERNAL;
733 typedef gpointer (*MonoTrampoline) (MonoMethod *method);
734 typedef gpointer (*MonoJumpTrampoline) (MonoDomain *domain, MonoMethod *method, gboolean add_sync_wrapper);
735 typedef gpointer (*MonoRemotingTrampoline) (MonoMethod *method, MonoRemotingTarget target);
736 typedef gpointer (*MonoDelegateTrampoline) (MonoClass *klass);
738 typedef gpointer (*MonoLookupDynamicToken) (MonoImage *image, guint32 token, gboolean valid_token, MonoClass **handle_class, MonoGenericContext *context);
740 typedef gboolean (*MonoGetCachedClassInfo) (MonoClass *klass, MonoCachedClassInfo *res);
742 typedef gboolean (*MonoGetClassFromName) (MonoImage *image, const char *name_space, const char *name, MonoClass **res);
745 mono_classes_init (void) MONO_INTERNAL;
748 mono_classes_cleanup (void) MONO_INTERNAL;
751 mono_class_layout_fields (MonoClass *klass) MONO_INTERNAL;
754 mono_class_setup_interface_offsets (MonoClass *klass) MONO_INTERNAL;
757 mono_class_setup_vtable_general (MonoClass *klass, MonoMethod **overrides, int onum) MONO_INTERNAL;
760 mono_class_setup_vtable (MonoClass *klass) MONO_INTERNAL;
763 mono_class_setup_methods (MonoClass *klass) MONO_INTERNAL;
766 mono_class_setup_mono_type (MonoClass *klass) MONO_INTERNAL;
769 mono_class_setup_parent (MonoClass *klass, MonoClass *parent) MONO_INTERNAL;
772 mono_class_setup_supertypes (MonoClass *klass) MONO_INTERNAL;
775 mono_class_get_method_by_index (MonoClass *class, int index) MONO_INTERNAL;
778 mono_class_get_implemented_interfaces (MonoClass *klass) MONO_INTERNAL;
781 mono_class_is_open_constructed_type (MonoType *t) MONO_INTERNAL;
784 mono_class_get_overrides_full (MonoImage *image, guint32 type_token, MonoMethod ***overrides, gint32 *num_overrides,
785 MonoGenericContext *generic_context) MONO_INTERNAL;
788 mono_class_get_cctor (MonoClass *klass) MONO_INTERNAL;
791 mono_class_get_finalizer (MonoClass *klass) MONO_INTERNAL;
794 mono_class_needs_cctor_run (MonoClass *klass, MonoMethod *caller) MONO_INTERNAL;
797 mono_class_field_is_special_static (MonoClassField *field) MONO_INTERNAL;
800 mono_class_has_special_static_fields (MonoClass *klass) MONO_INTERNAL;
803 mono_class_get_field_default_value (MonoClassField *field, MonoTypeEnum *def_type) MONO_INTERNAL;
806 mono_install_trampoline (MonoTrampoline func) MONO_INTERNAL;
809 mono_install_jump_trampoline (MonoJumpTrampoline func) MONO_INTERNAL;
812 mono_install_remoting_trampoline (MonoRemotingTrampoline func) MONO_INTERNAL;
815 mono_install_delegate_trampoline (MonoDelegateTrampoline func) MONO_INTERNAL;
818 mono_lookup_dynamic_token (MonoImage *image, guint32 token, MonoGenericContext *context) MONO_INTERNAL;
821 mono_lookup_dynamic_token_class (MonoImage *image, guint32 token, gboolean check_token, MonoClass **handle_class, MonoGenericContext *context) MONO_INTERNAL;
824 mono_install_lookup_dynamic_token (MonoLookupDynamicToken func) MONO_INTERNAL;
827 mono_runtime_create_jump_trampoline (MonoDomain *domain, MonoMethod *method, gboolean add_sync_wrapper) MONO_INTERNAL;
830 mono_runtime_create_delegate_trampoline (MonoClass *klass) MONO_INTERNAL;
833 mono_install_get_cached_class_info (MonoGetCachedClassInfo func) MONO_INTERNAL;
836 mono_install_get_class_from_name (MonoGetClassFromName func) MONO_INTERNAL;
839 mono_class_get_context (MonoClass *class) MONO_INTERNAL;
842 mono_method_get_context (MonoMethod *method) MONO_INTERNAL;
844 /* Used by monodis, thus cannot be MONO_INTERNAL */
845 MonoGenericContainer*
846 mono_method_get_generic_container (MonoMethod *method);
849 mono_generic_class_get_context (MonoGenericClass *gclass) MONO_INTERNAL;
852 mono_generic_class_get_class (MonoGenericClass *gclass) MONO_INTERNAL;
855 mono_method_set_generic_container (MonoMethod *method, MonoGenericContainer* container) MONO_INTERNAL;
858 mono_class_inflate_generic_method_full (MonoMethod *method, MonoClass *klass_hint, MonoGenericContext *context);
861 mono_method_inflated_lookup (MonoMethodInflated* method, gboolean cache) MONO_INTERNAL;
863 MonoMethodSignature *
864 mono_metadata_get_inflated_signature (MonoMethodSignature *sig, MonoGenericContext *context);
867 mono_class_inflate_generic_type_with_mempool (MonoMemPool *mempool, MonoType *type, MonoGenericContext *context) MONO_INTERNAL;
870 mono_metadata_free_inflated_signature (MonoMethodSignature *sig);
874 MonoClass *object_class;
875 MonoClass *byte_class;
876 MonoClass *void_class;
877 MonoClass *boolean_class;
878 MonoClass *sbyte_class;
879 MonoClass *int16_class;
880 MonoClass *uint16_class;
881 MonoClass *int32_class;
882 MonoClass *uint32_class;
883 MonoClass *int_class;
884 MonoClass *uint_class;
885 MonoClass *int64_class;
886 MonoClass *uint64_class;
887 MonoClass *single_class;
888 MonoClass *double_class;
889 MonoClass *char_class;
890 MonoClass *string_class;
891 MonoClass *enum_class;
892 MonoClass *array_class;
893 MonoClass *delegate_class;
894 MonoClass *multicastdelegate_class;
895 MonoClass *asyncresult_class;
896 MonoClass *waithandle_class;
897 MonoClass *typehandle_class;
898 MonoClass *fieldhandle_class;
899 MonoClass *methodhandle_class;
900 MonoClass *systemtype_class;
901 MonoClass *monotype_class;
902 MonoClass *exception_class;
903 MonoClass *threadabortexception_class;
904 MonoClass *thread_class;
905 MonoClass *transparent_proxy_class;
906 MonoClass *real_proxy_class;
907 MonoClass *mono_method_message_class;
908 MonoClass *appdomain_class;
909 MonoClass *field_info_class;
910 MonoClass *method_info_class;
911 MonoClass *stringbuilder_class;
912 MonoClass *math_class;
913 MonoClass *stack_frame_class;
914 MonoClass *stack_trace_class;
915 MonoClass *marshal_class;
916 MonoClass *iserializeable_class;
917 MonoClass *serializationinfo_class;
918 MonoClass *streamingcontext_class;
919 MonoClass *typed_reference_class;
920 MonoClass *argumenthandle_class;
921 MonoClass *marshalbyrefobject_class;
922 MonoClass *monitor_class;
923 MonoClass *iremotingtypeinfo_class;
924 MonoClass *runtimesecurityframe_class;
925 MonoClass *executioncontext_class;
926 MonoClass *internals_visible_class;
927 MonoClass *generic_ilist_class;
928 MonoClass *generic_nullable_class;
929 MonoClass *variant_class;
930 MonoClass *com_object_class;
931 MonoClass *com_interop_proxy_class;
932 MonoClass *iunknown_class;
933 MonoClass *idispatch_class;
934 MonoClass *safehandle_class;
935 MonoClass *handleref_class;
936 MonoClass *attribute_class;
937 MonoClass *customattribute_data_class;
940 extern MonoDefaults mono_defaults MONO_INTERNAL;
943 mono_loader_init (void) MONO_INTERNAL;
946 mono_loader_cleanup (void) MONO_INTERNAL;
949 mono_loader_lock (void) MONO_INTERNAL;
952 mono_loader_unlock (void) MONO_INTERNAL;
955 mono_loader_set_error_assembly_load (const char *assembly_name, gboolean ref_only) MONO_INTERNAL;
958 mono_loader_set_error_type_load (const char *class_name, const char *assembly_name) MONO_INTERNAL;
961 mono_loader_set_error_method_load (const char *class_name, const char *member_name) MONO_INTERNAL;
964 mono_loader_set_error_field_load (MonoClass *klass, const char *member_name) MONO_INTERNAL;
966 mono_loader_set_error_bad_image (char *msg) MONO_INTERNAL;
969 mono_loader_error_prepare_exception (MonoLoaderError *error) MONO_INTERNAL;
972 mono_loader_get_last_error (void) MONO_INTERNAL;
975 mono_loader_clear_error (void) MONO_INTERNAL;
978 mono_reflection_init (void) MONO_INTERNAL;
981 mono_icall_init (void) MONO_INTERNAL;
984 mono_icall_cleanup (void) MONO_INTERNAL;
987 mono_method_get_wrapper_data (MonoMethod *method, guint32 id) MONO_INTERNAL;
990 mono_install_stack_walk (MonoStackWalkImpl func) MONO_INTERNAL;
993 mono_metadata_has_generic_params (MonoImage *image, guint32 token) MONO_INTERNAL;
995 MonoGenericContainer *
996 mono_metadata_load_generic_params (MonoImage *image, guint32 token,
997 MonoGenericContainer *parent_container);
1000 mono_metadata_load_generic_param_constraints (MonoImage *image, guint32 token,
1001 MonoGenericContainer *container);
1003 MonoMethodSignature*
1004 mono_create_icall_signature (const char *sigstr) MONO_INTERNAL;
1007 mono_register_jit_icall (gconstpointer func, const char *name, MonoMethodSignature *sig, gboolean is_save) MONO_INTERNAL;
1010 mono_register_jit_icall_wrapper (MonoJitICallInfo *info, gconstpointer wrapper) MONO_INTERNAL;
1013 mono_find_jit_icall_by_name (const char *name) MONO_INTERNAL;
1016 mono_find_jit_icall_by_addr (gconstpointer addr) MONO_INTERNAL;
1019 mono_get_jit_icall_info (void) MONO_INTERNAL;
1022 mono_class_set_failure (MonoClass *klass, guint32 ex_type, void *ex_data) MONO_INTERNAL;
1025 mono_class_get_exception_data (MonoClass *klass) MONO_INTERNAL;
1028 mono_class_get_exception_for_failure (MonoClass *klass) MONO_INTERNAL;
1031 mono_type_get_name_full (MonoType *type, MonoTypeNameFormat format) MONO_INTERNAL;
1034 mono_type_get_full_name (MonoClass *class) MONO_INTERNAL;
1036 MonoArrayType *mono_dup_array_type (MonoMemPool *mp, MonoArrayType *a) MONO_INTERNAL;
1037 MonoMethodSignature *mono_metadata_signature_deep_dup (MonoMemPool *mp, MonoMethodSignature *sig) MONO_INTERNAL;
1040 mono_image_init_name_cache (MonoImage *image);
1042 gboolean mono_class_is_nullable (MonoClass *klass) MONO_INTERNAL;
1043 MonoClass *mono_class_get_nullable_param (MonoClass *klass) MONO_INTERNAL;
1045 /* object debugging functions, for use inside gdb */
1046 void mono_object_describe (MonoObject *obj);
1047 void mono_object_describe_fields (MonoObject *obj);
1048 void mono_value_describe_fields (MonoClass* klass, const char* addr);
1049 void mono_class_describe_statics (MonoClass* klass);
1051 /*Enum validation related functions*/
1053 mono_type_is_valid_enum_basetype (MonoType * type);
1056 mono_class_is_valid_enum (MonoClass *klass);
1059 mono_type_get_full (MonoImage *image, guint32 type_token, MonoGenericContext *context) MONO_INTERNAL;
1062 mono_generic_class_is_generic_type_definition (MonoGenericClass *gklass) MONO_INTERNAL;
1065 mono_method_get_declaring_generic_method (MonoMethod *method) MONO_INTERNAL;
1068 mono_class_get_method_generic (MonoClass *klass, MonoMethod *method) MONO_INTERNAL;
1071 mono_type_get_basic_type_from_generic (MonoType *type) MONO_INTERNAL;
1074 mono_class_generic_sharing_enabled (MonoClass *class) MONO_INTERNAL;
1077 mono_class_fill_runtime_generic_context (MonoVTable *class_vtable, guint32 slot) MONO_INTERNAL;
1080 mono_method_fill_runtime_generic_context (MonoMethodRuntimeGenericContext *mrgctx, guint32 slot) MONO_INTERNAL;
1082 MonoMethodRuntimeGenericContext*
1083 mono_method_lookup_rgctx (MonoVTable *class_vtable, MonoGenericInst *method_inst) MONO_INTERNAL;
1086 mono_method_needs_static_rgctx_invoke (MonoMethod *method, gboolean allow_type_vars) MONO_INTERNAL;
1089 mono_class_rgctx_get_array_size (int n, gboolean mrgctx) MONO_INTERNAL;
1092 mono_method_lookup_or_register_other_info (MonoMethod *method, gboolean in_mrgctx, gpointer data,
1093 int info_type, MonoGenericContext *generic_context) MONO_INTERNAL;
1096 mono_generic_context_check_used (MonoGenericContext *context) MONO_INTERNAL;
1099 mono_class_check_context_used (MonoClass *class) MONO_INTERNAL;
1102 mono_generic_context_is_sharable (MonoGenericContext *context, gboolean allow_type_vars) MONO_INTERNAL;
1105 mono_method_is_generic_impl (MonoMethod *method) MONO_INTERNAL;
1107 mono_method_is_generic_sharable_impl (MonoMethod *method, gboolean allow_type_vars) MONO_INTERNAL;
1110 mono_class_unregister_image_generic_subclasses (MonoImage *image) MONO_INTERNAL;
1113 mono_method_can_access_method_full (MonoMethod *method, MonoMethod *called, MonoClass *context_klass) MONO_INTERNAL;
1116 mono_method_can_access_field_full (MonoMethod *method, MonoClassField *field, MonoClass *context_klass) MONO_INTERNAL;
1119 mono_class_get_generic_type_definition (MonoClass *klass) MONO_INTERNAL;
1121 #endif /* __MONO_METADATA_CLASS_INTERBALS_H__ */