2 #ifndef __MONO_METADATA_INTERNALS_H__
3 #define __MONO_METADATA_INTERNALS_H__
5 #include "mono/metadata/image.h"
6 #include "mono/utils/mono-hash.h"
12 MonoAssemblyName aname;
16 gboolean corlib_internal;
24 struct _MonoTableInfo {
25 guint32 rows, row_size;
29 * Tables contain up to 9 columns and the possible sizes of the
30 * fields in the documentation are 1, 2 and 4 bytes. So we
31 * can encode in 2 bits the size.
33 * A 32 bit value can encode the resulting size
35 * The top eight bits encode the number of columns in the table.
36 * we only need 4, but 8 is aligned no shift required.
38 guint32 size_bitfield;
44 /* if f is NULL the image was loaded from raw data */
47 gboolean raw_data_allocated;
49 const char *assembly_name;
50 const char *module_name;
57 gboolean idx_string_wide, idx_guid_wide, idx_blob_wide;
59 MonoStreamHeader heap_strings;
60 MonoStreamHeader heap_us;
61 MonoStreamHeader heap_blob;
62 MonoStreamHeader heap_guid;
63 MonoStreamHeader heap_tables;
65 const char *tables_base;
67 MonoTableInfo tables [64];
70 * references is initialized only by using the mono_assembly_open
71 * function, and not by using the lowlevel mono_image_open.
73 * It is NULL terminated.
75 MonoAssembly **references;
83 * The Assembly this image was loaded from.
85 MonoAssembly *assembly;
88 * Indexed by method tokens and typedef tokens.
90 GHashTable *method_cache;
91 GHashTable *class_cache;
93 * Indexed by fielddef and memberref tokens
95 GHashTable *field_cache;
97 /* indexed by typespec tokens. */
98 GHashTable *typespec_cache;
99 /* indexed by token */
100 GHashTable *memberref_signatures;
101 GHashTable *helper_signatures;
104 * Indexes namespaces to hash tables that map class name to typedef token.
106 GHashTable *name_cache;
109 * Indexed by ((rank << 24) | (typedef & 0xffffff)), which limits us to a
110 * maximal rank of 255
112 GHashTable *array_cache;
115 * indexed by MonoMethodSignature
117 GHashTable *delegate_begin_invoke_cache;
118 GHashTable *delegate_end_invoke_cache;
119 GHashTable *delegate_invoke_cache;
122 * indexed by MonoMethod pointers
124 GHashTable *runtime_invoke_cache;
125 GHashTable *managed_wrapper_cache;
126 GHashTable *native_wrapper_cache;
127 GHashTable *remoting_invoke_cache;
128 GHashTable *synchronized_cache;
129 GHashTable *unbox_wrapper_cache;
131 void *reflection_info;
134 * user_info is a public field and is not touched by the
139 /* dll map entries */
142 /* Whenever this is a dynamically emitted module */
156 guint32 alloc_size; /* malloced bytes */
158 guint32 offset; /* from start of metadata */
164 guint32 row_size; /* calculated later with column_sizes */
166 guint32 column_sizes [9];
167 guint32 *values; /* rows * columns */
171 struct _MonoDynamicAssembly {
172 MonoAssembly assembly;
176 guint32 strong_name_size;
179 struct _MonoDynamicImage {
183 guint32 metadata_rva;
185 guint32 cli_header_offset;
189 guint32 imp_names_offset;
195 } sections [MONO_SECTION_MAX];
196 GHashTable *typespec;
198 GHashTable *handleref;
199 MonoGHashTable *tokens;
200 GHashTable *blob_cache;
201 GList *array_methods;
202 GPtrArray *gen_params;
203 MonoGHashTable *token_fixups;
204 GHashTable *method_to_table_idx;
205 GHashTable *field_to_table_idx;
206 GHashTable *method_aux_hash;
209 gboolean initial_image;
210 guint32 pe_kind, machine;
212 guint32 strong_name_size;
214 guint32 win32_res_size;
215 MonoDynamicStream sheap;
216 MonoDynamicStream code; /* used to store method headers and bytecode */
217 MonoDynamicStream resources; /* managed embedded resources */
218 MonoDynamicStream us;
219 MonoDynamicStream blob;
220 MonoDynamicStream tstream;
221 MonoDynamicStream guid;
222 MonoDynamicTable tables [64];
226 mono_metadata_interfaces_from_typedef_full (MonoImage *image,
229 MonoGenericContext *context);
232 mono_metadata_parse_array_full (MonoImage *image,
233 MonoGenericContext *generic_context,
238 mono_metadata_parse_type_full (MonoImage *image,
239 MonoGenericContext *generic_context,
240 MonoParseTypeMode mode,
246 mono_type_create_from_typespec_full (MonoImage *image,
247 MonoGenericContext *generic_context,
250 MonoMethodSignature *
251 mono_metadata_parse_signature_full (MonoImage *image,
252 MonoGenericContext *generic_context,
255 MonoMethodSignature *
256 mono_metadata_parse_method_signature_full (MonoImage *image,
257 MonoGenericContext *generic_context,
263 mono_metadata_parse_mh_full (MonoImage *image,
264 MonoGenericContext *generic_context,
268 mono_metadata_generic_method_hash (MonoGenericMethod *gmethod);
271 mono_metadata_generic_method_equal (MonoGenericMethod *g1,
272 MonoGenericMethod *g2);
275 mono_metadata_parse_generic_inst (MonoImage *image,
276 MonoGenericContext *generic_context,
282 mono_metadata_lookup_generic_inst (MonoGenericInst *ginst);
285 mono_metadata_lookup_generic_class (MonoGenericClass *gclass);
288 mono_metadata_inflate_generic_inst (MonoGenericInst *ginst,
289 MonoGenericContext *context);
291 #endif /* __MONO_METADATA_INTERNALS_H__ */