X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mono%2Fmetadata%2Fmetadata-internals.h;h=ea35f5b7c636a7b4f7cf08313a6e0f81ac7389fe;hb=9514523876b15962293ac5ad81393c0ae37780e9;hp=12eb5c15e85eb39dccc6371c5ab57c56ffeecc1f;hpb=cc0a7a9516a86b26b3cbeac5388f34ef81533831;p=mono.git diff --git a/mono/metadata/metadata-internals.h b/mono/metadata/metadata-internals.h index 12eb5c15e85..ea35f5b7c63 100644 --- a/mono/metadata/metadata-internals.h +++ b/mono/metadata/metadata-internals.h @@ -13,6 +13,7 @@ #include "mono/utils/mono-property-hash.h" #include "mono/utils/mono-value-hash.h" #include +#include "mono/utils/mono-conc-hashtable.h" struct _MonoType { union { @@ -203,7 +204,7 @@ struct _MonoImage { guint32 module_count; gboolean *modules_loaded; - MonoImage **files; + MonoImage **files; /*protected by the image lock*/ gpointer aot_module; @@ -224,10 +225,10 @@ struct _MonoImage { /* * Indexed by fielddef and memberref tokens */ - GHashTable *field_cache; /*protected by the image lock*/ + MonoConcurrentHashTable *field_cache; /*protected by the image lock*/ /* indexed by typespec tokens. */ - GHashTable *typespec_cache; + GHashTable *typespec_cache; /* protected by the image lock */ /* indexed by token */ GHashTable *memberref_signatures; GHashTable *helper_signatures; @@ -248,7 +249,7 @@ struct _MonoImage { GHashTable *szarray_cache; /* This has a separate lock to improve scalability */ - CRITICAL_SECTION szarray_cache_lock; + mono_mutex_t szarray_cache_lock; /* * indexed by MonoMethodSignature @@ -316,6 +317,7 @@ struct _MonoImage { MonoDllMap *dll_map; /* interfaces IDs from this image */ + /* protected by the classes lock */ MonoBitSet *interface_bitset; /* when the image is being closed, this is abused as a list of @@ -345,7 +347,7 @@ struct _MonoImage { * No other runtime locks must be taken while holding this lock. * It's meant to be used only to mutate and query structures part of this image. */ - CRITICAL_SECTION lock; + mono_mutex_t lock; }; /* @@ -361,7 +363,7 @@ typedef struct { GHashTable *gclass_cache, *ginst_cache, *gmethod_cache, *gsignature_cache; - CRITICAL_SECTION lock; + mono_mutex_t lock; /* * Memory for generic instances owned by this image set should be allocated from @@ -522,8 +524,42 @@ struct _MonoMethodSignature { MonoType *params [MONO_ZERO_LEN_ARRAY]; }; +/* + * AOT cache configuration loaded from config files. + * Doesn't really belong here. + */ +typedef struct { + /* + * Enable aot caching for applications whose main assemblies are in + * this list. + */ + GSList *apps; + GSList *assemblies; + char *aot_options; +} MonoAotCacheConfig; + #define MONO_SIZEOF_METHOD_SIGNATURE (sizeof (struct _MonoMethodSignature) - MONO_ZERO_LEN_ARRAY * SIZEOF_VOID_P) +static inline gboolean +image_is_dynamic (MonoImage *image) +{ +#ifdef DISABLE_REFLECTION_EMIT + return FALSE; +#else + return image->dynamic; +#endif +} + +static inline gboolean +assembly_is_dynamic (MonoAssembly *assembly) +{ +#ifdef DISABLE_REFLECTION_EMIT + return FALSE; +#else + return assembly->dynamic; +#endif +} + /* for use with allocated memory blocks (assumes alignment is to 8 bytes) */ guint mono_aligned_addr_hash (gconstpointer ptr) MONO_INTERNAL; @@ -577,7 +613,7 @@ void mono_remove_image_unload_hook (MonoImageUnloadFunc func, gpointer user_data) MONO_INTERNAL; void -mono_image_append_class_to_reflection_info_set (MonoClass *class) MONO_INTERNAL; +mono_image_append_class_to_reflection_info_set (MonoClass *klass) MONO_INTERNAL; gpointer mono_image_set_alloc (MonoImageSet *set, guint size) MONO_INTERNAL; @@ -764,5 +800,13 @@ MonoMethod *mono_get_method_constrained_with_method (MonoImage *image, MonoMetho void mono_type_set_alignment (MonoTypeEnum type, int align) MONO_INTERNAL; +MonoAotCacheConfig *mono_get_aot_cache_config (void) MONO_INTERNAL; +MonoType * +mono_type_create_from_typespec_checked (MonoImage *image, guint32 type_spec, MonoError *error) MONO_INTERNAL; + +MonoMethodSignature* +mono_method_get_signature_checked (MonoMethod *method, MonoImage *image, guint32 token, MonoGenericContext *context, MonoError *error) MONO_INTERNAL; + + #endif /* __MONO_METADATA_INTERNALS_H__ */