Fri Oct 6 16:57:26 CEST 2006 Paolo Molaro <lupus@ximian.com>
[mono.git] / mono / metadata / class-internals.h
index b12729fbf6a8a8d58a788fc3177633a54e36fb8c..c37b16bc49d3382653489a4a8e0abb8559d7e7ee 100644 (file)
@@ -30,6 +30,7 @@ typedef enum {
        MONO_WRAPPER_RUNTIME_INVOKE,
        MONO_WRAPPER_NATIVE_TO_MANAGED,
        MONO_WRAPPER_MANAGED_TO_NATIVE,
+       MONO_WRAPPER_MANAGED_TO_MANAGED,
        MONO_WRAPPER_REMOTING_INVOKE,
        MONO_WRAPPER_REMOTING_INVOKE_WITH_CHECK,
        MONO_WRAPPER_XDOMAIN_INVOKE,
@@ -82,7 +83,8 @@ struct _MonoMethod {
        unsigned int save_lmf:1;
        unsigned int dynamic:1; /* created & destroyed during runtime */
        unsigned int is_inflated:1; /* whether we're a MonoMethodInflated */
-       signed int slot : 21;
+       unsigned int skip_visibility:1; /* whenever to skip JIT visibility checks */
+       signed int slot : 20;
 };
 
 struct _MonoMethodNormal {
@@ -267,6 +269,12 @@ struct _MonoClass {
        /* next byte */
        guint has_static_refs : 1; /* it has static fields that are GC-tracked */
        guint no_special_static_fields : 1; /* has no thread/context static fields */
+       /* directly or indirectly derives from ComImport attributed class.
+        * this means we need to create a proxy for instances of this class
+        * for COM Interop. set this flag on loading so all we need is a quick check
+        * during object creation rather than having to traverse supertypes
+        */
+       guint is_com_object : 1; 
 
        guint8     exception_type;      /* MONO_EXCEPTION_* */
        void*      exception_data;      /* Additional information about the exception */
@@ -294,8 +302,11 @@ struct _MonoClass {
         * Computed object instance size, total.
         */
        int        instance_size;
-       int        class_size;
        int        vtable_size; /* number of slots */
+       union {
+               int class_size; /* size of area for static fields */
+               int element_size; /* for array types */
+       } sizes;
 
        /*
         * From the TypeDef table
@@ -353,6 +364,7 @@ struct MonoVTable {
        guint8      rank;
        guint remote          : 1; /* class is remotely activated */
        guint initialized     : 1; /* cctor has been run */
+       guint init_failed     : 1; /* cctor execution failed */
        /* do not add any fields after vtable, the structure is dynamically extended */
         gpointer    vtable [MONO_ZERO_LEN_ARRAY];      
 };
@@ -535,7 +547,9 @@ typedef struct {
 typedef struct {
        gulong new_object_count;
        gulong initialized_class_count;
+       gulong generic_vtable_count;
        gulong used_class_count;
+       gulong method_count;
        gulong class_vtable_size;
        gulong class_static_data_size;
        gulong generic_instance_count;
@@ -557,6 +571,8 @@ typedef gpointer (*MonoLookupDynamicToken) (MonoImage *image, guint32 token, Mon
 
 typedef gboolean (*MonoGetCachedClassInfo) (MonoClass *klass, MonoCachedClassInfo *res);
 
+typedef gboolean (*MonoGetClassFromName) (MonoImage *image, const char *name_space, const char *name, MonoClass **res);
+
 void
 mono_classes_init (void) MONO_INTERNAL;
 
@@ -630,6 +646,9 @@ mono_install_lookup_dynamic_token (MonoLookupDynamicToken func) MONO_INTERNAL;
 void
 mono_install_get_cached_class_info (MonoGetCachedClassInfo func) MONO_INTERNAL;
 
+void
+mono_install_get_class_from_name (MonoGetClassFromName func) MONO_INTERNAL;
+
 MonoInflatedGenericClass*
 mono_get_inflated_generic_class (MonoGenericClass *gclass) MONO_INTERNAL;
 
@@ -692,10 +711,11 @@ typedef struct {
        MonoClass *runtimesecurityframe_class;
        MonoClass *executioncontext_class;
        MonoClass *internals_visible_class;
-       MonoClass *generic_array_class;
+       MonoClass *generic_ilist_class;
        MonoClass *generic_nullable_class;
        MonoClass *variant_class;
        MonoClass *com_object_class;
+       MonoClass *com_interop_proxy_class;
 } MonoDefaults;
 
 extern MonoDefaults mono_defaults MONO_INTERNAL;
@@ -795,8 +815,17 @@ mono_type_get_full_name (MonoClass *class) MONO_INTERNAL;
 MonoArrayType *mono_dup_array_type (MonoArrayType *a) MONO_INTERNAL;
 MonoMethodSignature *mono_metadata_signature_deep_dup (MonoMethodSignature *sig) MONO_INTERNAL;
 
+void
+mono_image_init_name_cache (MonoImage *image);
+
 gboolean mono_class_is_nullable (MonoClass *klass) MONO_INTERNAL;
 MonoClass *mono_class_get_nullable_param (MonoClass *klass) MONO_INTERNAL;
 
+/* object debugging functions, for use inside gdb */
+void mono_object_describe        (MonoObject *obj);
+void mono_object_describe_fields (MonoObject *obj);
+void mono_value_describe_fields  (MonoClass* klass, const char* addr);
+void mono_class_describe_statics (MonoClass* klass);
+
 #endif /* __MONO_METADATA_CLASS_INTERBALS_H__ */