[aot] Rewrite the AOT profiler. (#4176)
[mono.git] / mono / metadata / class-internals.h
index 45d96dc24d681a9622d828b13da5995ab931138e..efb4c62874f58d543fbfcf3988b1d93064004d77 100644 (file)
@@ -10,7 +10,6 @@
 #include <mono/metadata/mempool.h>
 #include <mono/metadata/metadata-internals.h>
 #include <mono/metadata/property-bag.h>
-#include <mono/io-layer/io-layer.h>
 #include "mono/utils/mono-compiler.h"
 #include "mono/utils/mono-error.h"
 #include "mono/sgen/gc-internal-agnostic.h"
@@ -278,12 +277,15 @@ struct _MonoClass {
         * initialise all static fields.
         */
        /* size_inited is accessed without locks, so it needs a memory barrier */
+       /* All flag bits should be written while holding the loader lock */
        guint size_inited     : 1;
        guint valuetype       : 1; /* derives from System.ValueType */
        guint enumtype        : 1; /* derives from System.Enum */
        guint blittable       : 1; /* class is blittable */
        guint unicode         : 1; /* class uses unicode char when marshalled */
        guint wastypebuilder  : 1; /* class was created at runtime from a TypeBuilder */
+       guint is_array_special_interface : 1; /* gtd or ginst of once of the magic interfaces that arrays implement */
+
        /* next byte */
        guint8 min_align;
 
@@ -317,7 +319,6 @@ struct _MonoClass {
        guint has_finalize_inited    : 1; /* has_finalize is initialized */
        guint fields_inited : 1; /* setup_fields () has finished */
        guint has_failure : 1; /* See mono_class_get_exception_data () for a MonoErrorBoxed with the details */
-       guint is_array_special_interface : 1;
 
        MonoClass  *parent;
        MonoClass  *nested_in;
@@ -458,8 +459,9 @@ struct MonoVTable {
        guint8     *interface_bitmap;
        guint32     max_interface_id;
        guint8      rank;
+       /* Keep this a guint8, the jit depends on it */
+       guint8      initialized; /* cctor has been run */
        guint remote          : 1; /* class is remotely activated */
-       guint initialized     : 1; /* cctor has been run */
        guint init_failed     : 1; /* cctor execution failed */
        guint has_static_fields : 1; /* pointer to the data stored at the end of the vtable array */
        guint gc_bits         : MONO_VTABLE_AVAILABLE_GC_BITS; /* Those bits are reserved for the usaged of the GC */
@@ -997,16 +999,16 @@ mono_install_get_cached_class_info (MonoGetCachedClassInfo func);
 void
 mono_install_get_class_from_name (MonoGetClassFromName func);
 
-MonoGenericContext*
+MONO_PROFILER_API MonoGenericContext*
 mono_class_get_context (MonoClass *klass);
 
-MonoMethodSignature*
+MONO_PROFILER_API MonoMethodSignature*
 mono_method_signature_checked (MonoMethod *m, MonoError *err);
 
 MonoGenericContext*
 mono_method_get_context_general (MonoMethod *method, gboolean uninflated);
 
-MonoGenericContext*
+MONO_PROFILER_API MonoGenericContext*
 mono_method_get_context (MonoMethod *method);
 
 /* Used by monodis, thus cannot be MONO_INTERNAL */
@@ -1102,8 +1104,6 @@ typedef struct {
        MonoClass *argumenthandle_class;
        MonoClass *monitor_class;
        MonoClass *generic_ilist_class;
-       MonoClass *generic_icollection_class;
-       MonoClass *generic_ienumerable_class;
        MonoClass *generic_nullable_class;
        MonoClass *handleref_class;
        MonoClass *attribute_class;
@@ -1286,7 +1286,7 @@ MONO_API void mono_class_describe_statics (MonoClass* klass);
 /* method debugging functions, for use inside gdb */
 MONO_API void mono_method_print_code (MonoMethod *method);
 
-char *mono_signature_full_name (MonoMethodSignature *sig);
+MONO_PROFILER_API char *mono_signature_full_name (MonoMethodSignature *sig);
 
 /*Enum validation related functions*/
 MONO_API gboolean
@@ -1295,7 +1295,7 @@ mono_type_is_valid_enum_basetype (MonoType * type);
 MONO_API gboolean
 mono_class_is_valid_enum (MonoClass *klass);
 
-gboolean
+MONO_PROFILER_API gboolean
 mono_type_is_primitive (MonoType *type);
 
 MonoType *