2005-03-03 Sebastien Pouliot <sebastien@ximian.com>
[mono.git] / mono / metadata / class-internals.h
index c389b60db655220213b902716bf2b2e73a3af1fa..01a6f038fd27ce4e0fc80d4c7494721443a14cc6 100644 (file)
@@ -2,6 +2,7 @@
 #define __MONO_METADATA_CLASS_INTERBALS_H__
 
 #include <mono/metadata/class.h>
+#include <mono/metadata/object.h>
 #include <mono/io-layer/io-layer.h>
 
 #define MONO_CLASS_IS_ARRAY(c) ((c)->rank)
@@ -57,7 +58,6 @@ struct _MonoMethod {
        guint32 token;
        MonoClass *klass;
        MonoMethodSignature *signature;
-       gpointer info; /* runtime info */
        /* name is useful mostly for debugging */
        const char *name;
        /* this is used by the inlining algorithm */
@@ -180,6 +180,23 @@ struct _MonoEvent {
        guint32 attrs;
 };
 
+/* type of exception being "on hold" for later processing (see exception_type) */
+enum {
+       MONO_EXCEPTION_NONE = 0,
+       MONO_EXCEPTION_SECURITY_LINKDEMAND = 1,
+       MONO_EXCEPTION_SECURITY_INHERITANCEDEMAND = 2
+       /* add other exception type */
+};
+
+/* This struct collects the info needed for the runtime use of a class,
+ * like the vtables for a domain, the GC descriptor, etc.
+ */
+typedef struct {
+       guint16 max_domain;
+       /* domain_vtables is indexed by the domain id and the size is max_domain + 1 */
+       MonoVTable *domain_vtables [MONO_ZERO_LEN_ARRAY];
+} MonoClassRuntimeInfo;
+
 struct _MonoClass {
        MonoImage *image;
 
@@ -226,7 +243,9 @@ struct _MonoClass {
        guint has_references  : 1; /* it has GC-tracked references in the instance */
        guint has_static_refs : 1; /* it has static fields that are GC-tracked */
 
-       guint32 declsec_flags;     /* declarative security attributes flags */
+       guint32    declsec_flags;       /* declarative security attributes flags */
+       guint32    exception_type;      /* MONO_EXCEPTION_* */
+       void*      exception_data;      /* Additional information about the exception */
 
        MonoClass  *parent;
        MonoClass  *nested_in;
@@ -288,9 +307,8 @@ struct _MonoClass {
        void *reflection_info;
 
        void *gc_descr;
-       guint64 gc_bitmap;
 
-       MonoVTable *cached_vtable;
+       MonoClassRuntimeInfo *runtime_info;
 
        /* Generic vtable. Initialized by a call to mono_class_setup_vtable () */
        MonoMethod **vtable;    
@@ -598,5 +616,11 @@ mono_class_inflate_generic_signature (MonoImage *image, MonoMethodSignature *sig
 MonoGenericClass *
 mono_get_shared_generic_class (MonoGenericContainer *container, gboolean is_dynamic);
 
+gboolean
+mono_class_set_failure (MonoClass *klass, guint32 ex_type, void *ex_data);
+
+MonoException*
+mono_class_get_exception_for_failure (MonoClass *klass);
+
 #endif /* __MONO_METADATA_CLASS_INTERBALS_H__ */