#define __MONO_METADATA_INTERNALS_H__
#include "mono/metadata/image.h"
+#include "mono/metadata/blob.h"
+#include "mono/metadata/mempool.h"
+#include "mono/metadata/domain-internals.h"
#include "mono/utils/mono-hash.h"
struct _MonoAssembly {
- int ref_count;
+ int ref_count; /* use atomic operations only */
char *basedir;
- gboolean in_gac;
MonoAssemblyName aname;
GModule *aot_module;
MonoImage *image;
- /* Load files here */
- gboolean dynamic;
+ guint8 in_gac;
+ guint8 dynamic;
+ guint8 corlib_internal;
+ gboolean ref_only;
+ /* security manager flags (one bit is for lazy initialization) */
+ guint32 ecma:2; /* Has the ECMA key */
+ guint32 aptc:2; /* Has the [AllowPartiallyTrustedCallers] attributes */
+ guint32 fulltrust:2; /* Has FullTrust permission */
+ guint32 unmanaged:2; /* Has SecurityPermissionFlag.UnmanagedCode permission */
};
typedef struct {
} MonoStreamHeader;
struct _MonoTableInfo {
- guint32 rows, row_size;
const char *base;
+ guint rows : 24;
+ guint row_size : 8;
/*
* Tables contain up to 9 columns and the possible sizes of the
struct _MonoImage {
int ref_count;
- FILE *f;
- /* if f is NULL the image was loaded from raw data */
+ FILE *file_descr;
+ /* if file_descr is NULL the image was loaded from raw data */
char *raw_data;
guint32 raw_data_len;
- gboolean raw_data_allocated;
+ guint8 raw_data_allocated;
+
+ /* Whenever this is a dynamically emitted module */
+ guint8 dynamic;
+
+ /* Whenever this is a reflection only image */
+ guint8 ref_only;
+
char *name;
const char *assembly_name;
const char *module_name;
const char *version;
+ gint16 md_version_major, md_version_minor;
char *guid;
void *image_info;
+ MonoMemPool *mempool;
char *raw_metadata;
- gboolean idx_string_wide, idx_guid_wide, idx_blob_wide;
+ guint8 idx_string_wide, idx_guid_wide, idx_blob_wide;
MonoStreamHeader heap_strings;
MonoStreamHeader heap_us;
const char *tables_base;
- MonoTableInfo tables [64];
+ /**/
+ MonoTableInfo tables [MONO_TABLE_NUM];
/*
* references is initialized only by using the mono_assembly_open
GHashTable *memberref_signatures;
GHashTable *helper_signatures;
- /*
- * Indexed by MonoGenericInst.
- */
- GHashTable *generic_inst_cache;
-
/*
* Indexes namespaces to hash tables that map class name to typedef token.
*/
GHashTable *native_wrapper_cache;
GHashTable *remoting_invoke_cache;
GHashTable *synchronized_cache;
+ GHashTable *unbox_wrapper_cache;
void *reflection_info;
/* dll map entries */
GHashTable *dll_map;
-
- /* Whenever this is a dynamically emitted module */
- gboolean dynamic;
};
enum {
typedef struct {
guint32 alloc_rows;
guint32 rows;
- guint32 row_size; /* calculated later with column_sizes */
- guint32 columns;
- guint32 column_sizes [9];
- guint32 *values; /* rows * columns */
+ guint8 row_size; /* calculated later with column_sizes */
+ guint8 columns;
guint32 next_idx;
+ guint32 *values; /* rows * columns */
} MonoDynamicTable;
struct _MonoDynamicAssembly {
MonoAssembly assembly;
- gboolean run;
- gboolean save;
char *strong_name;
guint32 strong_name_size;
+ guint8 run;
+ guint8 save;
};
struct _MonoDynamicImage {
GHashTable *typeref;
GHashTable *handleref;
MonoGHashTable *tokens;
- MonoGHashTable *blob_cache;
+ GHashTable *blob_cache;
GList *array_methods;
GPtrArray *gen_params;
MonoGHashTable *token_fixups;
- MonoGHashTable *method_to_table_idx;
- MonoGHashTable *field_to_table_idx;
- MonoGHashTable *method_aux_hash;
+ GHashTable *method_to_table_idx;
+ GHashTable *field_to_table_idx;
+ GHashTable *method_aux_hash;
gboolean run;
gboolean save;
gboolean initial_image;
MonoDynamicStream blob;
MonoDynamicStream tstream;
MonoDynamicStream guid;
- MonoDynamicTable tables [64];
+ MonoDynamicTable tables [MONO_TABLE_NUM];
};
-MonoClass**
+/* Contains information about assembly binding */
+typedef struct _MonoAssemblyBindingInfo {
+ char *name;
+ char *culture;
+ guchar public_key_token [MONO_PUBLIC_KEY_TOKEN_LENGTH];
+ int major;
+ int minor;
+ AssemblyVersionSet old_version_bottom;
+ AssemblyVersionSet old_version_top;
+ AssemblyVersionSet new_version;
+ guint has_old_version_bottom : 1;
+ guint has_old_version_top : 1;
+ guint has_new_version : 1;
+ guint is_valid : 1;
+} MonoAssemblyBindingInfo;
+
+/* for use with allocated memory blocks (assumes alignment is to 8 bytes) */
+guint mono_aligned_addr_hash (gconstpointer ptr);
+
+const char * mono_meta_table_name (int table);
+void mono_metadata_compute_table_bases (MonoImage *meta);
+
+gboolean
mono_metadata_interfaces_from_typedef_full (MonoImage *image,
- guint32 table_index,
- guint *count,
- MonoGenericContext *context);
+ guint32 table_index,
+ MonoClass ***interfaces,
+ guint *count,
+ MonoGenericContext *context);
MonoArrayType *
mono_metadata_parse_array_full (MonoImage *image,
- MonoGenericContainer *generic_container,
+ MonoGenericContext *generic_context,
const char *ptr,
const char **rptr);
MonoType *
mono_metadata_parse_type_full (MonoImage *image,
- MonoGenericContainer *generic_container,
+ MonoGenericContext *generic_context,
MonoParseTypeMode mode,
short opt_attrs,
const char *ptr,
MonoType *
mono_type_create_from_typespec_full (MonoImage *image,
- MonoGenericContainer *generic_container,
+ MonoGenericContext *generic_context,
guint32 type_spec);
MonoMethodSignature *
MonoMethodHeader *
mono_metadata_parse_mh_full (MonoImage *image,
- MonoGenericContainer *generic_container,
+ MonoGenericContext *generic_context,
const char *ptr);
+guint
+mono_metadata_generic_method_hash (MonoGenericMethod *gmethod);
+
+gboolean
+mono_metadata_generic_method_equal (MonoGenericMethod *g1,
+ MonoGenericMethod *g2);
+
+MonoGenericInst *
+mono_metadata_parse_generic_inst (MonoImage *image,
+ MonoGenericContext *generic_context,
+ int count,
+ const char *ptr,
+ const char **rptr);
+
+MonoGenericInst *
+mono_metadata_lookup_generic_inst (MonoGenericInst *ginst);
+
+MonoGenericClass *
+mono_metadata_lookup_generic_class (MonoGenericClass *gclass);
+
+MonoGenericInst *
+mono_metadata_inflate_generic_inst (MonoGenericInst *ginst,
+ MonoGenericContext *context);
+
+void mono_dynamic_stream_reset (MonoDynamicStream* stream);
+void mono_assembly_addref (MonoAssembly *assembly);
+
+void mono_config_parse_publisher_policy (const char *filename, MonoAssemblyBindingInfo *binding_info);
+
+gboolean
+mono_assembly_name_parse_full (const char *name,
+ MonoAssemblyName *aname,
+ gboolean save_public_key,
+ gboolean *is_version_defined);
+
+guint32 mono_metadata_get_generic_param_row (MonoImage *image, guint32 token, guint32 *owner);
+
#endif /* __MONO_METADATA_INTERNALS_H__ */