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;
102 * Indexed by MonoGenericInst.
104 GHashTable *generic_inst_cache;
107 * Indexes namespaces to hash tables that map class name to typedef token.
109 GHashTable *name_cache;
112 * Indexed by ((rank << 24) | (typedef & 0xffffff)), which limits us to a
113 * maximal rank of 255
115 GHashTable *array_cache;
118 * indexed by MonoMethodSignature
120 GHashTable *delegate_begin_invoke_cache;
121 GHashTable *delegate_end_invoke_cache;
122 GHashTable *delegate_invoke_cache;
125 * indexed by MonoMethod pointers
127 GHashTable *runtime_invoke_cache;
128 GHashTable *managed_wrapper_cache;
129 GHashTable *native_wrapper_cache;
130 GHashTable *remoting_invoke_cache;
131 GHashTable *synchronized_cache;
133 void *reflection_info;
136 * user_info is a public field and is not touched by the
141 /* dll map entries */
144 /* Whenever this is a dynamically emitted module */
158 guint32 alloc_size; /* malloced bytes */
160 guint32 offset; /* from start of metadata */
166 guint32 row_size; /* calculated later with column_sizes */
168 guint32 column_sizes [9];
169 guint32 *values; /* rows * columns */
173 struct _MonoDynamicAssembly {
174 MonoAssembly assembly;
178 guint32 strong_name_size;
181 struct _MonoDynamicImage {
185 guint32 metadata_rva;
187 guint32 cli_header_offset;
191 guint32 imp_names_offset;
197 } sections [MONO_SECTION_MAX];
198 GHashTable *typespec;
200 GHashTable *handleref;
201 MonoGHashTable *tokens;
202 MonoGHashTable *blob_cache;
203 GList *array_methods;
204 MonoGHashTable *token_fixups;
205 MonoGHashTable *method_to_table_idx;
206 MonoGHashTable *field_to_table_idx;
207 MonoGHashTable *method_aux_hash;
211 guint32 strong_name_size;
213 guint32 win32_res_size;
214 MonoDynamicStream pefile;
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 #endif /* __MONO_METADATA_INTERNALS_H__ */