X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mono%2Fmetadata%2Fclass-internals.h;h=efb4c62874f58d543fbfcf3988b1d93064004d77;hb=2ba6bcbc48f8b4e145f9ad450fef8d411b728a8e;hp=40a8780dbbdd228d24efcaba92c53aa823c47779;hpb=bc59551adba37586276de65abe2433045d1b0d1f;p=mono.git diff --git a/mono/metadata/class-internals.h b/mono/metadata/class-internals.h index 40a8780dbbd..efb4c62874f 100644 --- a/mono/metadata/class-internals.h +++ b/mono/metadata/class-internals.h @@ -10,7 +10,6 @@ #include #include #include -#include #include "mono/utils/mono-compiler.h" #include "mono/utils/mono-error.h" #include "mono/sgen/gc-internal-agnostic.h" @@ -227,39 +226,21 @@ typedef struct { #define MONO_SIZEOF_CLASS_RUNTIME_INFO (sizeof (MonoClassRuntimeInfo) - MONO_ZERO_LEN_ARRAY * SIZEOF_VOID_P) -#define MONO_CLASS_PROP_EXCEPTION_DATA 0 - -/* - * This structure contains the rarely used fields of MonoClass - * Since using just one field causes the whole structure to be allocated, it should - * be used for fields which are only used in like 5% of all classes. - */ typedef struct { MonoPropertyBagItem head; - struct { -#if MONO_SMALL_CONFIG - guint16 first, count; -#else - guint32 first, count; -#endif - } property, event; - - /* Initialized by a call to mono_class_setup_properties () */ MonoProperty *properties; + guint32 first, count; + MonoFieldDefaultValue *def_values; +} MonoClassPropertyInfo; + +typedef struct { + MonoPropertyBagItem head; /* Initialized by a call to mono_class_setup_events () */ MonoEvent *events; - - guint32 declsec_flags; /* declarative security attributes flags */ - - /* Default values/RVA for fields and properties */ - /* Accessed using mono_class_get_field_default_value () / mono_field_get_data () */ - MonoFieldDefaultValue *field_def_values; - MonoFieldDefaultValue *prop_def_values; - - GList *nested_classes; -} MonoClassExt; + guint32 first, count; +} MonoClassEventInfo; typedef enum { MONO_CLASS_DEF = 1, /* non-generic type */ @@ -296,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; @@ -334,7 +318,7 @@ struct _MonoClass { guint simd_type : 1; /* class is a simd intrinsic type */ guint has_finalize_inited : 1; /* has_finalize is initialized */ guint fields_inited : 1; /* setup_fields () has finished */ - guint has_failure : 1; /* See MONO_CLASS_PROP_EXCEPTION_DATA for a MonoErrorBoxed with the details */ + guint has_failure : 1; /* See mono_class_get_exception_data () for a MonoErrorBoxed with the details */ MonoClass *parent; MonoClass *nested_in; @@ -475,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 */ @@ -909,9 +894,6 @@ typedef struct { extern MonoStats mono_stats; -typedef gpointer (*MonoRemotingTrampoline) (MonoDomain *domain, MonoMethod *method, MonoRemotingTarget target, MonoError *error); -typedef gpointer (*MonoDelegateTrampoline) (MonoDomain *domain, MonoClass *klass); - typedef gboolean (*MonoGetCachedClassInfo) (MonoClass *klass, MonoCachedClassInfo *res); typedef gboolean (*MonoGetClassFromName) (MonoImage *image, const char *name_space, const char *name, MonoClass **res); @@ -999,9 +981,6 @@ mono_class_get_field_default_value (MonoClassField *field, MonoTypeEnum *def_typ const char* mono_class_get_property_default_value (MonoProperty *property, MonoTypeEnum *def_type); -void -mono_install_delegate_trampoline (MonoDelegateTrampoline func); - gpointer mono_lookup_dynamic_token (MonoImage *image, guint32 token, MonoGenericContext *context, MonoError *error); @@ -1020,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 */ @@ -1143,9 +1122,6 @@ typedef struct { MonoRemoteClass* mono_remote_class (MonoDomain *domain, MonoString *class_name, MonoClass *proxy_class, MonoError *error); -void -mono_install_remoting_trampoline (MonoRemotingTrampoline func); - #define mono_class_is_transparent_proxy(klass) ((klass) == mono_defaults.transparent_proxy_class) #define mono_class_is_real_proxy(klass) ((klass) == mono_defaults.real_proxy_class) #define mono_object_is_transparent_proxy(object) (((MonoObject*)object)->vtable->klass == mono_defaults.transparent_proxy_class) @@ -1310,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 @@ -1319,6 +1295,9 @@ mono_type_is_valid_enum_basetype (MonoType * type); MONO_API gboolean mono_class_is_valid_enum (MonoClass *klass); +MONO_PROFILER_API gboolean +mono_type_is_primitive (MonoType *type); + MonoType * mono_type_get_checked (MonoImage *image, guint32 type_token, MonoGenericContext *context, MonoError *error); @@ -1367,9 +1346,6 @@ mono_class_alloc (MonoClass *klass, int size); gpointer mono_class_alloc0 (MonoClass *klass, int size); -void -mono_class_alloc_ext (MonoClass *klass); - void mono_class_setup_interfaces (MonoClass *klass, MonoError *error); @@ -1499,18 +1475,48 @@ mono_class_get_marshal_info (MonoClass *class); void mono_class_set_marshal_info (MonoClass *class, MonoMarshalType *marshal_info); -MonoClassExt* -mono_class_get_ext (MonoClass *class); - -void -mono_class_set_ext (MonoClass *class, MonoClassExt *ext); - guint32 mono_class_get_ref_info_handle (MonoClass *class); guint32 mono_class_set_ref_info_handle (MonoClass *class, guint32 value); +MonoErrorBoxed* +mono_class_get_exception_data (MonoClass *klass); + +void +mono_class_set_exception_data (MonoClass *klass, MonoErrorBoxed *value); + +GList* +mono_class_get_nested_classes_property (MonoClass *klass); + +void +mono_class_set_nested_classes_property (MonoClass *klass, GList *value); + +MonoClassPropertyInfo* +mono_class_get_property_info (MonoClass *klass); + +void +mono_class_set_property_info (MonoClass *klass, MonoClassPropertyInfo *info); + +MonoClassEventInfo* +mono_class_get_event_info (MonoClass *klass); + +void +mono_class_set_event_info (MonoClass *klass, MonoClassEventInfo *info); + +MonoFieldDefaultValue* +mono_class_get_field_def_values (MonoClass *klass); + +void +mono_class_set_field_def_values (MonoClass *klass, MonoFieldDefaultValue *values); + +guint32 +mono_class_get_declsec_flags (MonoClass *class); + +void +mono_class_set_declsec_flags (MonoClass *class, guint32 value); + /*Now that everything has been defined, let's include the inline functions */ #include