Revert "Revert "Merge branch 'master' of https://github.com/mono/mono""
[mono.git] / mono / metadata / domain-internals.h
index b73be9382a4e5a7676dc06ef978e90df2dfd7c10..09c6479c03d3805e5e1f6f12a43ba7f530168154 100644 (file)
@@ -190,7 +190,11 @@ struct _MonoJitInfo {
           next_jit_code_hash) must be in the same order and at the
           same offset as in RuntimeMethod, because of the jit_code_hash
           internal hash table in MonoDomain. */
-       MonoMethod *method;
+       union {
+               MonoMethod *method;
+               MonoImage *image;
+               gpointer aot_info;
+       } d;
        struct _MonoJitInfo *next_jit_code_hash;
        gpointer    code_start;
        /* This might contain an id for the unwind info instead of a register mask */
@@ -207,6 +211,12 @@ struct _MonoJitInfo {
        gboolean    from_llvm:1;
        gboolean    dbg_hidden_inited:1;
        gboolean    dbg_hidden:1;
+       /* Whenever this jit info was loaded in async context */
+       gboolean    async:1;
+       gboolean    dbg_step_through_inited:1;
+       gboolean    dbg_step_through:1;
+       gboolean    dbg_non_user_code_inited:1;
+       gboolean    dbg_non_user_code:1;
 
        /* FIXME: Embed this after the structure later*/
        gpointer    gc_info; /* Currently only used by SGen */
@@ -226,6 +236,17 @@ struct _MonoAppContext {
        gpointer *static_data;
 };
 
+/* Lock-free allocator */
+typedef struct {
+       guint8 *mem;
+       gpointer prev;
+       int size, pos;
+} LockFreeMempoolChunk;
+
+typedef struct {
+       LockFreeMempoolChunk *current, *chunks;
+} LockFreeMempool;
+
 /*
  * We have two unloading states because the domain
  * must remain fully functional while AppDomain::DomainUnload is
@@ -315,10 +336,17 @@ struct _MonoDomain {
        int                 num_jit_info_tables;
        MonoJitInfoTable * 
          volatile          jit_info_table;
+       /*
+        * Contains information about AOT loaded code.
+        * Only used in the root domain.
+        */
+       MonoJitInfoTable *
+         volatile          aot_modules;
        GSList             *jit_info_free_queue;
        /* Used when loading assemblies */
        gchar **search_path;
        gchar *private_bin_path;
+       LockFreeMempool *lock_free_mp;
        
        /* Used by remoting proxies */
        MonoMethod         *create_proxy_for_type_method;
@@ -444,9 +472,6 @@ mono_jit_info_get_generic_sharing_context (MonoJitInfo *ji) MONO_INTERNAL;
 void
 mono_jit_info_set_generic_sharing_context (MonoJitInfo *ji, MonoGenericSharingContext *gsctx) MONO_INTERNAL;
 
-MonoJitInfo*
-mono_domain_lookup_shared_generic (MonoDomain *domain, MonoMethod *method) MONO_INTERNAL;
-
 char *
 mono_make_shadow_copy (const char *filename) MONO_INTERNAL;
 
@@ -459,6 +484,9 @@ mono_domain_alloc  (MonoDomain *domain, guint size) MONO_INTERNAL;
 gpointer
 mono_domain_alloc0 (MonoDomain *domain, guint size) MONO_INTERNAL;
 
+gpointer
+mono_domain_alloc0_lock_free (MonoDomain *domain, guint size) MONO_INTERNAL;
+
 void*
 mono_domain_code_reserve (MonoDomain *domain, int size) MONO_LLVM_INTERNAL;
 
@@ -629,4 +657,6 @@ void mono_assembly_cleanup_domain_bindings (guint32 domain_id) MONO_INTERNAL;
 
 MonoJitInfo* mono_jit_info_table_find_internal (MonoDomain *domain, char *addr, gboolean try_aot) MONO_INTERNAL;
 
+void mono_enable_debug_domain_unload (gboolean enable);
+
 #endif /* __MONO_METADATA_DOMAIN_INTERNALS_H__ */