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;
82 * The Assembly this image was loaded from.
84 MonoAssembly *assembly;
87 * Indexed by method tokens and typedef tokens.
89 GHashTable *method_cache;
90 GHashTable *class_cache;
92 * Indexed by fielddef and memberref tokens
94 GHashTable *field_cache;
96 /* indexed by typespec tokens. */
97 GHashTable *typespec_cache;
98 /* indexed by token */
99 GHashTable *memberref_signatures;
100 GHashTable *helper_signatures;
103 * Indexed by MonoGenericInst.
105 GHashTable *generic_inst_cache;
108 * Indexes namespaces to hash tables that map class name to typedef token.
110 GHashTable *name_cache;
113 * Indexed by ((rank << 24) | (typedef & 0xffffff)), which limits us to a
114 * maximal rank of 255
116 GHashTable *array_cache;
119 * indexed by MonoMethodSignature
121 GHashTable *delegate_begin_invoke_cache;
122 GHashTable *delegate_end_invoke_cache;
123 GHashTable *delegate_invoke_cache;
126 * indexed by MonoMethod pointers
128 GHashTable *runtime_invoke_cache;
129 GHashTable *managed_wrapper_cache;
130 GHashTable *native_wrapper_cache;
131 GHashTable *remoting_invoke_cache;
132 GHashTable *synchronized_cache;
134 void *reflection_info;
137 * user_info is a public field and is not touched by the
142 /* dll map entries */
145 /* Whenever this is a dynamically emitted module */
159 guint32 alloc_size; /* malloced bytes */
161 guint32 offset; /* from start of metadata */
167 guint32 row_size; /* calculated later with column_sizes */
169 guint32 column_sizes [9];
170 guint32 *values; /* rows * columns */
174 struct _MonoDynamicAssembly {
175 MonoAssembly assembly;
179 guint32 strong_name_size;
182 struct _MonoDynamicImage {
186 guint32 metadata_rva;
188 guint32 cli_header_offset;
192 guint32 imp_names_offset;
198 } sections [MONO_SECTION_MAX];
199 GHashTable *typespec;
201 GHashTable *handleref;
202 MonoGHashTable *tokens;
203 MonoGHashTable *blob_cache;
204 GList *array_methods;
205 MonoGHashTable *token_fixups;
206 MonoGHashTable *method_to_table_idx;
207 MonoGHashTable *field_to_table_idx;
208 MonoGHashTable *method_aux_hash;
212 guint32 strong_name_size;
214 guint32 win32_res_size;
215 MonoDynamicStream pefile;
216 MonoDynamicStream sheap;
217 MonoDynamicStream code; /* used to store method headers and bytecode */
218 MonoDynamicStream resources; /* managed embedded resources */
219 MonoDynamicStream us;
220 MonoDynamicStream blob;
221 MonoDynamicStream tstream;
222 MonoDynamicStream guid;
223 MonoDynamicTable tables [64];
227 #endif /* __MONO_METADATA_INTERNALS_H__ */