};
/* type of exception being "on hold" for later processing (see exception_type) */
-enum {
+typedef enum {
MONO_EXCEPTION_NONE = 0,
MONO_EXCEPTION_INVALID_PROGRAM = 3,
MONO_EXCEPTION_UNVERIFIABLE_IL = 4,
MONO_EXCEPTION_INLINE_FAILED = 15,
MONO_EXCEPTION_MONO_ERROR = 16,
/* add other exception type */
-};
+} MonoExceptionType;
/* This struct collects the info needed for the runtime use of a class,
* like the vtables for a domain, the GC descriptor, etc.
int instance_size; /* object instance size */
guint inited : 1;
- /* We use init_pending to detect cyclic calls to mono_class_init */
- guint init_pending : 1;
/* A class contains static and non static data. Static data can be
* of the same type as the class itselfs, but it does not influence
guint is_generic : 1; /* class is a generic type definition */
guint is_inflated : 1; /* class is a generic instance */
guint has_finalize_inited : 1; /* has_finalize is initialized */
- guint fields_inited : 1; /* fields is initialized */
- guint setup_fields_called : 1; /* to prevent infinite loops in setup_fields */
-
- guint8 exception_type; /* MONO_EXCEPTION_* */
-
- /* Additional information about the exception */
- /* Stored as property MONO_CLASS_PROP_EXCEPTION_DATA */
- //void *exception_data;
+ guint fields_inited : 1; /* setup_fields () has finished */
+ guint has_failure : 1; /* See MONO_CLASS_PROP_EXCEPTION_DATA for a MonoErrorBoxed with the details */
MonoClass *parent;
MonoClass *nested_in;
struct _MonoGenericClass {
MonoClass *container_class; /* the generic type definition */
MonoGenericContext context; /* a context that contains the type instantiation doesn't contain any method instantiation */ /* FIXME: Only the class_inst member of "context" is ever used, so this field could be replaced with just a monogenericinst */
- guint is_dynamic : 1; /* We're a MonoDynamicGenericClass */
+ guint is_dynamic : 1; /* Contains dynamic types */
guint is_tb_open : 1; /* This is the fully open instantiation for a type_builder. Quite ugly, but it's temporary.*/
+ guint need_sync : 1; /* Only if dynamic. Need to be synchronized with its container class after its finished. */
MonoClass *cached_class; /* if present, the MonoClass corresponding to the instantiation. */
/*
MonoImageSet *owner;
};
-/*
- * This is used when instantiating a generic type definition which is
- * a TypeBuilder.
- */
-struct _MonoDynamicGenericClass {
- MonoGenericClass generic_class;
- int count_fields;
- MonoClassField *fields;
- guint initialized;
- /* The non-inflated types of the fields */
- MonoType **field_generic_types;
- /* The managed objects representing the fields */
- MonoObject **field_objects;
-};
-
/*
* A type parameter.
*/
mono_class_setup_supertypes (MonoClass *klass);
void
-mono_class_setup_fields_locking (MonoClass *klass);
+mono_class_setup_fields (MonoClass *klass);
/* WARNING
* Only call this function if you can ensure both @klass and @parent
size_t imt_slots_with_collisions;
size_t imt_max_collisions_in_slot;
size_t imt_method_count_when_max_collisions;
- size_t imt_thunks_size;
+ size_t imt_trampolines_size;
size_t jit_info_table_insert_count;
size_t jit_info_table_remove_count;
size_t jit_info_table_lookup_count;
mono_classes_cleanup (void);
void
-mono_class_layout_fields (MonoClass *klass, int instance_size);
+mono_class_layout_fields (MonoClass *klass, int base_instance_size, int packing_size, gboolean sre);
void
mono_class_setup_interface_offsets (MonoClass *klass);
mono_lookup_jit_icall_symbol (const char *name);
gboolean
-mono_class_set_failure (MonoClass *klass, guint32 ex_type, void *ex_data);
-
-gpointer
-mono_class_get_exception_data (MonoClass *klass);
+mono_class_set_type_load_failure (MonoClass *klass, const char * fmt, ...) MONO_ATTR_FORMAT_PRINTF(2,3);
MonoException*
mono_class_get_exception_for_failure (MonoClass *klass);
MonoGenericClass*
mono_class_get_generic_class (MonoClass *klass);
+gpointer
+mono_class_alloc (MonoClass *klass, int size);
+
+gpointer
+mono_class_alloc0 (MonoClass *klass, int size);
+
void
mono_class_alloc_ext (MonoClass *klass);
mono_unload_interface_id (MonoClass *klass);
GPtrArray*
-mono_class_get_methods_by_name (MonoClass *klass, const char *name, guint32 bflags, gboolean ignore_case, gboolean allow_ctors, MonoException **ex);
+mono_class_get_methods_by_name (MonoClass *klass, const char *name, guint32 bflags, gboolean ignore_case, gboolean allow_ctors, MonoError *error);
char*
mono_class_full_name (MonoClass *klass);
mono_class_try_load_from_name (MonoImage *image, const char* name_space, const char *name);
void
-mono_error_set_for_class_failure (MonoError *orerror, MonoClass *klass);
+mono_error_set_for_class_failure (MonoError *orerror, const MonoClass *klass);
-static inline guint8
-mono_class_get_failure (MonoClass *klass)
-{
- g_assert (klass != NULL);
- return klass->exception_type;
-}
-
-static inline gboolean
-mono_class_has_failure (MonoClass *klass)
-{
- g_assert (klass != NULL);
- return mono_class_get_failure (klass) != MONO_EXCEPTION_NONE;
-}
+gboolean
+mono_class_has_failure (const MonoClass *klass);
#endif /* __MONO_METADATA_CLASS_INTERNALS_H__ */