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;
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 * Indexed by MonoGenericClass.
106 GHashTable *generic_class_cache;
109 * Indexes namespaces to hash tables that map class name to typedef token.
111 GHashTable *name_cache;
114 * Indexed by ((rank << 24) | (typedef & 0xffffff)), which limits us to a
115 * maximal rank of 255
117 GHashTable *array_cache;
120 * indexed by MonoMethodSignature
122 GHashTable *delegate_begin_invoke_cache;
123 GHashTable *delegate_end_invoke_cache;
124 GHashTable *delegate_invoke_cache;
127 * indexed by MonoMethod pointers
129 GHashTable *runtime_invoke_cache;
130 GHashTable *managed_wrapper_cache;
131 GHashTable *native_wrapper_cache;
132 GHashTable *remoting_invoke_cache;
133 GHashTable *synchronized_cache;
135 void *reflection_info;
138 * user_info is a public field and is not touched by the
143 /* dll map entries */
146 /* Whenever this is a dynamically emitted module */
160 guint32 alloc_size; /* malloced bytes */
162 guint32 offset; /* from start of metadata */
168 guint32 row_size; /* calculated later with column_sizes */
170 guint32 column_sizes [9];
171 guint32 *values; /* rows * columns */
175 struct _MonoDynamicAssembly {
176 MonoAssembly assembly;
180 guint32 strong_name_size;
183 struct _MonoDynamicImage {
187 guint32 metadata_rva;
189 guint32 cli_header_offset;
193 guint32 imp_names_offset;
199 } sections [MONO_SECTION_MAX];
200 GHashTable *typespec;
202 GHashTable *handleref;
203 MonoGHashTable *tokens;
204 MonoGHashTable *blob_cache;
205 GList *array_methods;
206 GPtrArray *gen_params;
207 MonoGHashTable *token_fixups;
208 MonoGHashTable *method_to_table_idx;
209 MonoGHashTable *field_to_table_idx;
210 MonoGHashTable *method_aux_hash;
213 gboolean initial_image;
214 guint32 pe_kind, machine;
216 guint32 strong_name_size;
218 guint32 win32_res_size;
219 MonoDynamicStream sheap;
220 MonoDynamicStream code; /* used to store method headers and bytecode */
221 MonoDynamicStream resources; /* managed embedded resources */
222 MonoDynamicStream us;
223 MonoDynamicStream blob;
224 MonoDynamicStream tstream;
225 MonoDynamicStream guid;
226 MonoDynamicTable tables [64];
230 mono_metadata_interfaces_from_typedef_full (MonoImage *image,
233 MonoGenericContext *context);
236 mono_metadata_parse_array_full (MonoImage *image,
237 MonoGenericContainer *generic_container,
242 mono_metadata_parse_type_full (MonoImage *image,
243 MonoGenericContainer *generic_container,
244 MonoParseTypeMode mode,
250 mono_type_create_from_typespec_full (MonoImage *image,
251 MonoGenericContainer *generic_container,
254 MonoMethodSignature *
255 mono_metadata_parse_signature_full (MonoImage *image,
256 MonoGenericContainer *generic_container,
259 MonoMethodSignature *
260 mono_metadata_parse_method_signature_full (MonoImage *image,
261 MonoGenericContainer *generic_container,
267 mono_metadata_parse_mh_full (MonoImage *image,
268 MonoGenericContainer *generic_container,
272 mono_metadata_generic_method_hash (MonoGenericMethod *gmethod);
275 mono_metadata_generic_method_equal (MonoGenericMethod *g1,
276 MonoGenericMethod *g2);
278 #endif /* __MONO_METADATA_INTERNALS_H__ */