#include "mono/utils/mono-property-hash.h"
#include "mono/utils/mono-value-hash.h"
#include <mono/utils/mono-error.h>
+#include "mono/utils/mono-conc-hashtable.h"
struct _MonoType {
union {
guint32 module_count;
gboolean *modules_loaded;
- MonoImage **files;
+ MonoImage **files; /*protected by the image lock*/
gpointer aot_module;
/*
* 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;
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
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
* 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;
};
/*
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
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;
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;
MonoMethod *mono_get_method_constrained_with_method (MonoImage *image, MonoMethod *method, MonoClass *constrained_class, MonoGenericContext *context) MONO_INTERNAL;
+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__ */