Tue Sep 11 16:08:08 CEST 2007 Paolo Molaro <lupus@ximian.com>
[mono.git] / mono / metadata / class-internals.h
index 3acf698693aae012cb2a99cabf93996b18b4f976..90a1e4d5279c512e3b4db106c869a3bc38a30a89 100644 (file)
@@ -171,7 +171,10 @@ enum {
        MONO_EXCEPTION_UNVERIFIABLE_IL = 4,
        MONO_EXCEPTION_MISSING_METHOD = 5,
        MONO_EXCEPTION_MISSING_FIELD = 6,
-       MONO_EXCEPTION_TYPE_LOAD = 7
+       MONO_EXCEPTION_TYPE_LOAD = 7,
+       MONO_EXCEPTION_FILE_NOT_FOUND = 8,
+       MONO_EXCEPTION_METHOD_ACCESS = 9,
+       MONO_EXCEPTION_FIELD_ACCESS = 10,
        /* add other exception type */
 };
 
@@ -358,7 +361,6 @@ struct _MonoGenericInst {
        guint id;                       /* unique ID for debugging */
        guint type_argc    : 22;        /* number of type arguments */
        guint is_open      :  1;        /* if this is an open type */
-       guint is_reference :  1;        /* if this is a reference type */
        MonoType **type_argv;
 };
 
@@ -429,8 +431,6 @@ struct _MonoGenericContainer {
        /* If we're a generic method definition in a generic type definition,
           the generic container of the containing class. */
        MonoGenericContainer *parent;
-       /* If we're a generic method definition, caches all their instantiations. */
-       GHashTable *method_hash;
        /* the generic type definition or the generic method definition corresponding to this container */
        union {
                MonoClass *klass;
@@ -489,18 +489,8 @@ typedef struct {
        MonoMethodSignature *sig;
 } MonoJitICallInfo;
 
-/*
- * Information about a type load error encountered by the loader.
- */
-typedef enum {
-       MONO_LOADER_ERROR_TYPE,
-       MONO_LOADER_ERROR_METHOD,
-       MONO_LOADER_ERROR_FIELD,
-       MONO_LOADER_ERROR_ASSEMBLY
-} MonoLoaderErrorKind;
-
 typedef struct {
-       MonoLoaderErrorKind kind;
+       guint8 exception_type;
        char *class_name; /* If kind == TYPE */
        char *assembly_name; /* If kind == TYPE or ASSEMBLY */
        MonoClass *klass; /* If kind != TYPE */
@@ -535,6 +525,10 @@ typedef struct {
        gulong imt_max_collisions_in_slot;
        gulong imt_method_count_when_max_collisions;
        gulong imt_thunks_size;
+       gulong jit_info_table_insert_count;
+       gulong jit_info_table_remove_count;
+       gulong jit_info_table_lookup_count;
+       gulong hazardous_pointer_count;
        gboolean enabled;
 } MonoStats;
 
@@ -562,7 +556,7 @@ typedef gpointer (*MonoTrampoline)       (MonoMethod *method);
 typedef gpointer (*MonoRemotingTrampoline)       (MonoMethod *method, MonoRemotingTarget target);
 typedef gpointer (*MonoDelegateTrampoline)       (MonoClass *klass);
 
-typedef gpointer (*MonoLookupDynamicToken) (MonoImage *image, guint32 token, MonoClass **handle_class);
+typedef gpointer (*MonoLookupDynamicToken) (MonoImage *image, guint32 token, MonoClass **handle_class, MonoGenericContext *context);
 
 typedef gboolean (*MonoGetCachedClassInfo) (MonoClass *klass, MonoCachedClassInfo *res);
 
@@ -630,10 +624,10 @@ void
 mono_install_delegate_trampoline (MonoDelegateTrampoline func) MONO_INTERNAL;
 
 gpointer
-mono_lookup_dynamic_token (MonoImage *image, guint32 token) MONO_INTERNAL;
+mono_lookup_dynamic_token (MonoImage *image, guint32 token, MonoGenericContext *context) MONO_INTERNAL;
 
 gpointer
-mono_lookup_dynamic_token_class (MonoImage *image, guint32 token, MonoClass **handle_class) MONO_INTERNAL;
+mono_lookup_dynamic_token_class (MonoImage *image, guint32 token, MonoClass **handle_class, MonoGenericContext *context) MONO_INTERNAL;
 
 void
 mono_install_lookup_dynamic_token (MonoLookupDynamicToken func) MONO_INTERNAL;
@@ -659,6 +653,8 @@ mono_generic_class_get_class (MonoGenericClass *gclass) MONO_INTERNAL;
 MonoMethod*
 mono_class_inflate_generic_method_full (MonoMethod *method, MonoClass *klass_hint, MonoGenericContext *context);
 
+MonoMethodInflated*
+mono_method_inflated_lookup (MonoMethodInflated* method, gboolean cache) MONO_INTERNAL;
 
 typedef struct {
        MonoImage *corlib;
@@ -831,5 +827,15 @@ void mono_object_describe_fields (MonoObject *obj);
 void mono_value_describe_fields  (MonoClass* klass, const char* addr);
 void mono_class_describe_statics (MonoClass* klass);
 
+/*Enum validation related functions*/
+gboolean
+mono_type_is_valid_enum_basetype (MonoType * type);
+
+gboolean
+mono_class_is_valid_enum (MonoClass *klass);
+
+MonoType *
+mono_type_get_full        (MonoImage *image, guint32 type_token, MonoGenericContext *context) MONO_INTERNAL;
+
 #endif /* __MONO_METADATA_CLASS_INTERBALS_H__ */