Disable inlining if the assembly has a DebuggableAttribute with the IsJITOptimizerDis...
[mono.git] / mono / metadata / metadata-internals.h
1
2 #ifndef __MONO_METADATA_INTERNALS_H__
3 #define __MONO_METADATA_INTERNALS_H__
4
5 #include "mono/metadata/image.h"
6 #include "mono/metadata/blob.h"
7 #include "mono/metadata/mempool.h"
8 #include "mono/metadata/domain-internals.h"
9 #include "mono/metadata/mono-hash.h"
10 #include "mono/utils/mono-compiler.h"
11 #include "mono/utils/mono-dl.h"
12 #include "mono/utils/monobitset.h"
13 #include "mono/utils/mono-property-hash.h"
14 #include "mono/utils/mono-value-hash.h"
15 #include <mono/utils/mono-error.h>
16
17 struct _MonoType {
18         union {
19                 MonoClass *klass; /* for VALUETYPE and CLASS */
20                 MonoType *type;   /* for PTR */
21                 MonoArrayType *array; /* for ARRAY */
22                 MonoMethodSignature *method;
23                 MonoGenericParam *generic_param; /* for VAR and MVAR */
24                 MonoGenericClass *generic_class; /* for GENERICINST */
25         } data;
26         unsigned int attrs    : 16; /* param attributes or field flags */
27         MonoTypeEnum type     : 8;
28         unsigned int num_mods : 6;  /* max 64 modifiers follow at the end */
29         unsigned int byref    : 1;
30         unsigned int pinned   : 1;  /* valid when included in a local var signature */
31         MonoCustomMod modifiers [MONO_ZERO_LEN_ARRAY]; /* this may grow */
32 };
33
34 #define MONO_SIZEOF_TYPE (offsetof (struct _MonoType, modifiers))
35
36 #define MONO_SECMAN_FLAG_INIT(x)                (x & 0x2)
37 #define MONO_SECMAN_FLAG_GET_VALUE(x)           (x & 0x1)
38 #define MONO_SECMAN_FLAG_SET_VALUE(x,y)         do { x = ((y) ? 0x3 : 0x2); } while (0)
39
40 #define MONO_PUBLIC_KEY_TOKEN_LENGTH    17
41
42 struct _MonoAssemblyName {
43         const char *name;
44         const char *culture;
45         const char *hash_value;
46         const mono_byte* public_key;
47         // string of 16 hex chars + 1 NULL
48         mono_byte public_key_token [MONO_PUBLIC_KEY_TOKEN_LENGTH];
49         uint32_t hash_alg;
50         uint32_t hash_len;
51         uint32_t flags;
52         uint16_t major, minor, build, revision;
53 };
54
55 struct MonoTypeNameParse {
56         char *name_space;
57         char *name;
58         MonoAssemblyName assembly;
59         GList *modifiers; /* 0 -> byref, -1 -> pointer, > 0 -> array rank */
60         GPtrArray *type_arguments;
61         GList *nested;
62 };
63
64 struct _MonoAssembly {
65         /* 
66          * The number of appdomains which have this assembly loaded plus the number of 
67          * assemblies referencing this assembly through an entry in their image->references
68          * arrays. The later is needed because entries in the image->references array
69          * might point to assemblies which are only loaded in some appdomains, and without
70          * the additional reference, they can be freed at any time.
71          * The ref_count is initially 0.
72          */
73         int ref_count; /* use atomic operations only */
74         char *basedir;
75         MonoAssemblyName aname;
76         MonoImage *image;
77         GSList *friend_assembly_names; /* Computed by mono_assembly_load_friends () */
78         guint8 friend_assembly_names_inited;
79         guint8 in_gac;
80         guint8 dynamic;
81         guint8 corlib_internal;
82         gboolean ref_only;
83         guint8 wrap_non_exception_throws;
84         guint8 wrap_non_exception_throws_inited;
85         guint8 jit_optimizer_disabled;
86         guint8 jit_optimizer_disabled_inited;
87         /* security manager flags (one bit is for lazy initialization) */
88         guint32 ecma:2;         /* Has the ECMA key */
89         guint32 aptc:2;         /* Has the [AllowPartiallyTrustedCallers] attributes */
90         guint32 fulltrust:2;    /* Has FullTrust permission */
91         guint32 unmanaged:2;    /* Has SecurityPermissionFlag.UnmanagedCode permission */
92         guint32 skipverification:2;     /* Has SecurityPermissionFlag.SkipVerification permission */
93 };
94
95 typedef struct {
96         const char* data;
97         guint32  size;
98 } MonoStreamHeader;
99
100 struct _MonoTableInfo {
101         const char *base;
102         guint       rows     : 24;
103         guint       row_size : 8;
104
105         /*
106          * Tables contain up to 9 columns and the possible sizes of the
107          * fields in the documentation are 1, 2 and 4 bytes.  So we
108          * can encode in 2 bits the size.
109          *
110          * A 32 bit value can encode the resulting size
111          *
112          * The top eight bits encode the number of columns in the table.
113          * we only need 4, but 8 is aligned no shift required. 
114          */
115         guint32   size_bitfield;
116 };
117
118 #define REFERENCE_MISSING ((gpointer) -1)
119
120 typedef struct _MonoDllMap MonoDllMap;
121
122 struct _MonoImage {
123         /*
124          * The number of assemblies which reference this MonoImage though their 'image'
125          * field plus the number of images which reference this MonoImage through their 
126          * 'modules' field, plus the number of threads holding temporary references to
127          * this image between calls of mono_image_open () and mono_image_close ().
128          */
129         int   ref_count;
130         void *raw_data_handle;
131         char *raw_data;
132         guint32 raw_data_len;
133         guint8 raw_buffer_used    : 1;
134         guint8 raw_data_allocated : 1;
135
136 #ifdef HOST_WIN32
137         /* Module was loaded using LoadLibrary. */
138         guint8 is_module_handle : 1;
139
140         /* Module entry point is _CorDllMain. */
141         guint8 has_entry_point : 1;
142 #endif
143
144         /* Whenever this is a dynamically emitted module */
145         guint8 dynamic : 1;
146
147         /* Whenever this is a reflection only image */
148         guint8 ref_only : 1;
149
150         /* Whenever this image contains uncompressed metadata */
151         guint8 uncompressed_metadata : 1;
152
153         guint8 checked_module_cctor : 1;
154         guint8 has_module_cctor : 1;
155
156         guint8 idx_string_wide : 1;
157         guint8 idx_guid_wide : 1;
158         guint8 idx_blob_wide : 1;
159
160         /* Whenever this image is considered as platform code for the CoreCLR security model */
161         guint8 core_clr_platform_code : 1;
162                             
163         char *name;
164         const char *assembly_name;
165         const char *module_name;
166         char *version;
167         gint16 md_version_major, md_version_minor;
168         char *guid;
169         void *image_info;
170         MonoMemPool         *mempool; /*protected by the image lock*/
171
172         char                *raw_metadata;
173                             
174         MonoStreamHeader     heap_strings;
175         MonoStreamHeader     heap_us;
176         MonoStreamHeader     heap_blob;
177         MonoStreamHeader     heap_guid;
178         MonoStreamHeader     heap_tables;
179                             
180         const char          *tables_base;
181
182         /**/
183         MonoTableInfo        tables [MONO_TABLE_NUM];
184
185         /*
186          * references is initialized only by using the mono_assembly_open
187          * function, and not by using the lowlevel mono_image_open.
188          *
189          * It is NULL terminated.
190          */
191         MonoAssembly **references;
192
193         MonoImage **modules;
194         guint32 module_count;
195         gboolean *modules_loaded;
196
197         MonoImage **files;
198
199         gpointer aot_module;
200
201         /*
202          * The Assembly this image was loaded from.
203          */
204         MonoAssembly *assembly;
205
206         /*
207          * Indexed by method tokens and typedef tokens.
208          */
209         GHashTable *method_cache; /*protected by the image lock*/
210         MonoInternalHashTable class_cache;
211
212         /* Indexed by memberref + methodspec tokens */
213         GHashTable *methodref_cache; /*protected by the image lock*/
214
215         /*
216          * Indexed by fielddef and memberref tokens
217          */
218         GHashTable *field_cache;
219
220         /* indexed by typespec tokens. */
221         GHashTable *typespec_cache;
222         /* indexed by token */
223         GHashTable *memberref_signatures;
224         GHashTable *helper_signatures;
225
226         /* Indexed by blob heap indexes */
227         GHashTable *method_signatures;
228
229         /*
230          * Indexes namespaces to hash tables that map class name to typedef token.
231          */
232         GHashTable *name_cache;  /*protected by the image lock*/
233
234         /*
235          * Indexed by MonoClass
236          */
237         GHashTable *array_cache;
238         GHashTable *ptr_cache;
239
240         GHashTable *szarray_cache;
241         /* This has a separate lock to improve scalability */
242         CRITICAL_SECTION szarray_cache_lock;
243
244         /*
245          * indexed by MonoMethodSignature 
246          */
247         GHashTable *delegate_begin_invoke_cache;
248         GHashTable *delegate_end_invoke_cache;
249         GHashTable *delegate_invoke_cache;
250         GHashTable *runtime_invoke_cache;
251
252         /*
253          * indexed by SignatureMethodPair
254          */
255         GHashTable *delegate_abstract_invoke_cache;
256
257         /*
258          * indexed by SignatureMethodPair
259          */
260         GHashTable *delegate_bound_static_invoke_cache;
261         /*
262          * indexed by MonoMethod pointers 
263          */
264         GHashTable *runtime_invoke_direct_cache;
265         GHashTable *runtime_invoke_vcall_cache;
266         GHashTable *managed_wrapper_cache;
267         GHashTable *native_wrapper_cache;
268         GHashTable *native_wrapper_aot_cache;
269         GHashTable *remoting_invoke_cache;
270         GHashTable *synchronized_cache;
271         GHashTable *unbox_wrapper_cache;
272         GHashTable *cominterop_invoke_cache;
273         GHashTable *cominterop_wrapper_cache; /* LOCKING: marshal lock */
274         GHashTable *thunk_invoke_cache;
275
276         /*
277          * indexed by MonoClass pointers
278          */
279         GHashTable *ldfld_wrapper_cache;
280         GHashTable *ldflda_wrapper_cache;
281         GHashTable *stfld_wrapper_cache;
282         GHashTable *isinst_cache;
283         GHashTable *castclass_cache;
284         GHashTable *proxy_isinst_cache;
285         GHashTable *rgctx_template_hash; /* LOCKING: templates lock */
286
287         /* Contains rarely used fields of runtime structures belonging to this image */
288         MonoPropertyHash *property_hash;
289
290         void *reflection_info;
291
292         /*
293          * user_info is a public field and is not touched by the
294          * metadata engine
295          */
296         void *user_info;
297
298         /* dll map entries */
299         MonoDllMap *dll_map;
300
301         /* interfaces IDs from this image */
302         MonoBitSet *interface_bitset;
303
304         /* when the image is being closed, this is abused as a list of
305            malloc'ed regions to be freed. */
306         GSList *reflection_info_unregister_classes;
307
308         /* List of image sets containing this image */
309         GSList *image_sets;
310
311         /*
312          * No other runtime locks must be taken while holding this lock.
313          * It's meant to be used only to mutate and query structures part of this image.
314          */
315         CRITICAL_SECTION    lock;
316 };
317
318 /*
319  * Generic instances depend on many images, and they need to be deleted if one
320  * of the images they depend on is unloaded. For example,
321  * List<Foo> depends on both List's image and Foo's image.
322  * A MonoImageSet is the owner of all generic instances depending on the same set of
323  * images.
324  */
325 typedef struct {
326         int nimages;
327         MonoImage **images;
328
329         GHashTable *gclass_cache, *ginst_cache, *gmethod_cache, *gsignature_cache;
330
331         CRITICAL_SECTION    lock;
332
333         /*
334          * Memory for generic instances owned by this image set should be allocated from
335          * this mempool, using the mono_image_set_alloc family of functions.
336          */
337         MonoMemPool         *mempool;
338 } MonoImageSet;
339
340 enum {
341         MONO_SECTION_TEXT,
342         MONO_SECTION_RSRC,
343         MONO_SECTION_RELOC,
344         MONO_SECTION_MAX
345 };
346
347 typedef struct {
348         GHashTable *hash;
349         char *data;
350         guint32 alloc_size; /* malloced bytes */
351         guint32 index;
352         guint32 offset; /* from start of metadata */
353 } MonoDynamicStream;
354
355 typedef struct {
356         guint32 alloc_rows;
357         guint32 rows;
358         guint8  row_size; /*  calculated later with column_sizes */
359         guint8  columns;
360         guint32 next_idx;
361         guint32 *values; /* rows * columns */
362 } MonoDynamicTable;
363
364 struct _MonoDynamicAssembly {
365         MonoAssembly assembly;
366         char *strong_name;
367         guint32 strong_name_size;
368         guint8 run;
369         guint8 save;
370         MonoDomain *domain;
371 };
372
373 struct _MonoDynamicImage {
374         MonoImage image;
375         guint32 meta_size;
376         guint32 text_rva;
377         guint32 metadata_rva;
378         guint32 image_base;
379         guint32 cli_header_offset;
380         guint32 iat_offset;
381         guint32 idt_offset;
382         guint32 ilt_offset;
383         guint32 imp_names_offset;
384         struct {
385                 guint32 rva;
386                 guint32 size;
387                 guint32 offset;
388                 guint32 attrs;
389         } sections [MONO_SECTION_MAX];
390         GHashTable *typespec;
391         GHashTable *typeref;
392         GHashTable *handleref;
393         MonoGHashTable *handleref_managed;
394         MonoGHashTable *tokens;
395         GHashTable *blob_cache;
396         GHashTable *standalonesig_cache;
397         GList *array_methods;
398         GPtrArray *gen_params;
399         MonoGHashTable *token_fixups;
400         GHashTable *method_to_table_idx;
401         GHashTable *field_to_table_idx;
402         GHashTable *method_aux_hash;
403         GHashTable *vararg_aux_hash;
404         MonoGHashTable *generic_def_objects;
405         MonoGHashTable *methodspec;
406         gboolean run;
407         gboolean save;
408         gboolean initial_image;
409         guint32 pe_kind, machine;
410         char *strong_name;
411         guint32 strong_name_size;
412         char *win32_res;
413         guint32 win32_res_size;
414         guint8 *public_key;
415         int public_key_len;
416         MonoDynamicStream sheap;
417         MonoDynamicStream code; /* used to store method headers and bytecode */
418         MonoDynamicStream resources; /* managed embedded resources */
419         MonoDynamicStream us;
420         MonoDynamicStream blob;
421         MonoDynamicStream tstream;
422         MonoDynamicStream guid;
423         MonoDynamicTable tables [MONO_TABLE_NUM];
424         MonoClass *wrappers_type; /*wrappers are bound to this type instead of <Module>*/
425 };
426
427 /* Contains information about assembly binding */
428 typedef struct _MonoAssemblyBindingInfo {
429         char *name;
430         char *culture;
431         guchar public_key_token [MONO_PUBLIC_KEY_TOKEN_LENGTH];
432         int major;
433         int minor;
434         AssemblyVersionSet old_version_bottom;
435         AssemblyVersionSet old_version_top;
436         AssemblyVersionSet new_version;
437         guint has_old_version_bottom : 1;
438         guint has_old_version_top : 1;
439         guint has_new_version : 1;
440         guint is_valid : 1;
441 } MonoAssemblyBindingInfo;
442
443 struct _MonoMethodHeader {
444         const unsigned char  *code;
445 #ifdef MONO_SMALL_CONFIG
446         guint16      code_size;
447 #else
448         guint32      code_size;
449 #endif
450         guint16      max_stack   : 15;
451         unsigned int is_transient: 1; /* mono_metadata_free_mh () will actually free this header */
452         unsigned int num_clauses : 15;
453         /* if num_locals != 0, then the following apply: */
454         unsigned int init_locals : 1;
455         guint16      num_locals;
456         MonoExceptionClause *clauses;
457         MonoType    *locals [MONO_ZERO_LEN_ARRAY];
458 };
459
460 typedef struct {
461         guint32      code_size;
462         gboolean     has_clauses;
463 } MonoMethodHeaderSummary;
464
465 #define MONO_SIZEOF_METHOD_HEADER (sizeof (struct _MonoMethodHeader) - MONO_ZERO_LEN_ARRAY * SIZEOF_VOID_P)
466
467 struct _MonoMethodSignature {
468         MonoType     *ret;
469 #ifdef MONO_SMALL_CONFIG
470         guint8        param_count;
471         gint8         sentinelpos;
472         unsigned int  generic_param_count : 5;
473 #else
474         guint16       param_count;
475         gint16        sentinelpos;
476         unsigned int  generic_param_count : 16;
477 #endif
478         unsigned int  call_convention     : 6;
479         unsigned int  hasthis             : 1;
480         unsigned int  explicit_this       : 1;
481         unsigned int  pinvoke             : 1;
482         unsigned int  is_inflated         : 1;
483         unsigned int  has_type_parameters : 1;
484         MonoType     *params [MONO_ZERO_LEN_ARRAY];
485 };
486
487 #define MONO_SIZEOF_METHOD_SIGNATURE (sizeof (struct _MonoMethodSignature) - MONO_ZERO_LEN_ARRAY * SIZEOF_VOID_P)
488
489 /* for use with allocated memory blocks (assumes alignment is to 8 bytes) */
490 guint mono_aligned_addr_hash (gconstpointer ptr) MONO_INTERNAL;
491
492 void
493 mono_image_check_for_module_cctor (MonoImage *image) MONO_INTERNAL;
494
495 gpointer
496 mono_image_alloc  (MonoImage *image, guint size) MONO_INTERNAL;
497
498 gpointer
499 mono_image_alloc0 (MonoImage *image, guint size) MONO_INTERNAL;
500
501 char*
502 mono_image_strdup (MonoImage *image, const char *s) MONO_INTERNAL;
503
504 GList*
505 g_list_prepend_image (MonoImage *image, GList *list, gpointer data) MONO_INTERNAL;
506
507 GSList*
508 g_slist_append_image (MonoImage *image, GSList *list, gpointer data) MONO_INTERNAL;
509
510 void
511 mono_image_lock (MonoImage *image) MONO_INTERNAL;
512
513 void
514 mono_image_unlock (MonoImage *image) MONO_INTERNAL;
515
516 gpointer
517 mono_image_property_lookup (MonoImage *image, gpointer subject, guint32 property) MONO_INTERNAL;
518
519 void
520 mono_image_property_insert (MonoImage *image, gpointer subject, guint32 property, gpointer value) MONO_INTERNAL;
521
522 void
523 mono_image_property_remove (MonoImage *image, gpointer subject) MONO_INTERNAL;
524
525 gboolean
526 mono_image_close_except_pools (MonoImage *image) MONO_INTERNAL;
527
528 void
529 mono_image_close_finish (MonoImage *image) MONO_INTERNAL;
530
531 typedef void  (*MonoImageUnloadFunc) (MonoImage *image, gpointer user_data);
532
533 void
534 mono_install_image_unload_hook (MonoImageUnloadFunc func, gpointer user_data) MONO_INTERNAL;
535
536 void
537 mono_remove_image_unload_hook (MonoImageUnloadFunc func, gpointer user_data) MONO_INTERNAL;
538
539 MonoType*
540 mono_metadata_get_shared_type (MonoType *type) MONO_INTERNAL;
541
542 GSList*
543 mono_metadata_clean_for_image (MonoImage *image) MONO_INTERNAL;
544
545 void
546 mono_metadata_clean_generic_classes_for_image (MonoImage *image) MONO_INTERNAL;
547
548 void
549 mono_metadata_cleanup (void);
550
551 const char *   mono_meta_table_name              (int table) MONO_INTERNAL;
552 void           mono_metadata_compute_table_bases (MonoImage *meta) MONO_INTERNAL;
553
554 gboolean
555 mono_metadata_interfaces_from_typedef_full  (MonoImage             *image,
556                                                                                          guint32                table_index,
557                                                                                          MonoClass           ***interfaces,
558                                                                                          guint                 *count,
559                                                                                          gboolean               heap_alloc_result,
560                                                                                          MonoGenericContext    *context) MONO_INTERNAL;
561
562 MonoArrayType *
563 mono_metadata_parse_array_full              (MonoImage             *image,
564                                              MonoGenericContainer  *container,
565                                              const char            *ptr,
566                                              const char           **rptr) MONO_INTERNAL;
567
568 MonoType *
569 mono_metadata_parse_type_full               (MonoImage             *image,
570                                              MonoGenericContainer  *container,
571                                              MonoParseTypeMode      mode,
572                                              short                  opt_attrs,
573                                              const char            *ptr,
574                                              const char           **rptr);
575
576 MonoMethodSignature *
577 mono_metadata_parse_signature_full          (MonoImage             *image,
578                                              MonoGenericContainer  *generic_container,
579                                              guint32                token) MONO_INTERNAL;
580
581 MonoMethodSignature *
582 mono_metadata_parse_method_signature_full   (MonoImage             *image,
583                                              MonoGenericContainer  *generic_container,
584                                              int                     def,
585                                              const char             *ptr,
586                                              const char            **rptr);
587
588 MonoMethodHeader *
589 mono_metadata_parse_mh_full                 (MonoImage             *image,
590                                              MonoGenericContainer  *container,
591                                              const char            *ptr);
592
593 gboolean
594 mono_method_get_header_summary (MonoMethod *method, MonoMethodHeaderSummary *summary) MONO_INTERNAL;
595
596 int* mono_metadata_get_param_attrs          (MonoImage *m, int def, int param_count) MONO_INTERNAL;
597 gboolean mono_metadata_method_has_param_attrs (MonoImage *m, int def) MONO_INTERNAL;
598
599 guint
600 mono_metadata_generic_context_hash          (const MonoGenericContext *context) MONO_INTERNAL;
601
602 gboolean
603 mono_metadata_generic_context_equal         (const MonoGenericContext *g1,
604                                              const MonoGenericContext *g2) MONO_INTERNAL;
605
606 MonoGenericInst *
607 mono_metadata_parse_generic_inst            (MonoImage             *image,
608                                              MonoGenericContainer  *container,
609                                              int                    count,
610                                              const char            *ptr,
611                                              const char           **rptr) MONO_INTERNAL;
612
613 MonoGenericInst *
614 mono_metadata_get_generic_inst              (int                    type_argc,
615                                              MonoType             **type_argv) MONO_INTERNAL;
616
617 MonoGenericClass *
618 mono_metadata_lookup_generic_class          (MonoClass             *gclass,
619                                              MonoGenericInst       *inst,
620                                              gboolean               is_dynamic) MONO_INTERNAL;
621
622 MonoGenericInst * mono_metadata_inflate_generic_inst  (MonoGenericInst *ginst, MonoGenericContext *context, MonoError *error) MONO_INTERNAL;
623
624 void mono_dynamic_stream_reset  (MonoDynamicStream* stream) MONO_INTERNAL;
625 void mono_assembly_addref       (MonoAssembly *assembly) MONO_INTERNAL;
626 void mono_assembly_load_friends (MonoAssembly* ass) MONO_INTERNAL;
627 gboolean mono_assembly_has_skip_verification (MonoAssembly* ass) MONO_INTERNAL;
628
629 gboolean mono_assembly_close_except_image_pools (MonoAssembly *assembly) MONO_INTERNAL;
630 void mono_assembly_close_finish (MonoAssembly *assembly) MONO_INTERNAL;
631
632
633 gboolean mono_public_tokens_are_equal (const unsigned char *pubt1, const unsigned char *pubt2) MONO_INTERNAL;
634
635 void mono_config_parse_publisher_policy (const char *filename, MonoAssemblyBindingInfo *binding_info) MONO_INTERNAL;
636 void mono_config_parse_assembly_bindings (const char *filename, int major, int minor, void *user_data,
637                                           void (*infocb)(MonoAssemblyBindingInfo *info, void *user_data)) MONO_INTERNAL;
638
639 gboolean
640 mono_assembly_name_parse_full                (const char           *name,
641                                               MonoAssemblyName     *aname,
642                                               gboolean save_public_key,
643                                               gboolean *is_version_defined,
644                                                   gboolean *is_token_defined) MONO_INTERNAL;
645
646 guint32 mono_metadata_get_generic_param_row (MonoImage *image, guint32 token, guint32 *owner);
647
648 void mono_unload_interface_ids (MonoBitSet *bitset) MONO_INTERNAL;
649
650
651 MonoType *mono_metadata_type_dup (MonoImage *image, const MonoType *original) MONO_INTERNAL;
652 MonoMethodSignature  *mono_metadata_signature_dup_full (MonoImage *image,MonoMethodSignature *sig) MONO_INTERNAL;
653 MonoMethodSignature  *mono_metadata_signature_dup_mempool (MonoMemPool *mp, MonoMethodSignature *sig) MONO_INTERNAL;
654
655 MonoGenericInst *
656 mono_get_shared_generic_inst (MonoGenericContainer *container) MONO_INTERNAL;
657
658 int
659 mono_type_stack_size_internal (MonoType *t, int *align, gboolean allow_open) MONO_INTERNAL;
660
661 void            mono_type_get_desc (GString *res, MonoType *type, mono_bool include_namespace);
662
663 gboolean
664 mono_metadata_type_equal_full (MonoType *t1, MonoType *t2, gboolean signature_only) MONO_INTERNAL;
665
666 MonoMarshalSpec *
667 mono_metadata_parse_marshal_spec_full (MonoImage *image, const char *ptr) MONO_INTERNAL;
668
669 guint          mono_metadata_generic_inst_hash (gconstpointer data) MONO_INTERNAL;
670 gboolean       mono_metadata_generic_inst_equal (gconstpointer ka, gconstpointer kb) MONO_INTERNAL;
671
672 void
673 mono_metadata_field_info_with_mempool (
674                                           MonoImage *meta, 
675                                       guint32       table_index,
676                                       guint32      *offset,
677                                       guint32      *rva,
678                                       MonoMarshalSpec **marshal_spec);
679
680 MonoClassField*
681 mono_metadata_get_corresponding_field_from_generic_type_definition (MonoClassField *field) MONO_INTERNAL;
682
683 MonoEvent*
684 mono_metadata_get_corresponding_event_from_generic_type_definition (MonoEvent *event) MONO_INTERNAL;
685
686 MonoProperty*
687 mono_metadata_get_corresponding_property_from_generic_type_definition (MonoProperty *property) MONO_INTERNAL;
688
689 guint32
690 mono_metadata_signature_size (MonoMethodSignature *sig) MONO_INTERNAL;
691
692 guint mono_metadata_str_hash (gconstpointer v1) MONO_INTERNAL;
693
694 gboolean mono_image_load_pe_data (MonoImage *image) MONO_INTERNAL;
695
696 gboolean mono_image_load_cli_data (MonoImage *image) MONO_INTERNAL;
697
698 void mono_image_load_names (MonoImage *image) MONO_INTERNAL;
699
700 MonoImage *mono_image_open_raw (const char *fname, MonoImageOpenStatus *status) MONO_INTERNAL;
701
702 MonoException *mono_get_exception_field_access_msg (const char *msg) MONO_INTERNAL;
703
704 MonoException *mono_get_exception_method_access_msg (const char *msg) MONO_INTERNAL;
705
706 MonoMethod* method_from_method_def_or_ref (MonoImage *m, guint32 tok, MonoGenericContext *context) MONO_INTERNAL;
707
708 #endif /* __MONO_METADATA_INTERNALS_H__ */
709