X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mono%2Fmetadata%2Fobject-internals.h;h=e59a4d4eb9c1fa0f3f34b670cc58009f646b86e3;hb=3f011fdb1d5afcb204821af8628830e7c4cbd050;hp=22f13dcaddb66133ccb3a50f628f166371ed2ff8;hpb=c8a98eb84f7d2316f9214776edd5514430cb6ca2;p=mono.git diff --git a/mono/metadata/object-internals.h b/mono/metadata/object-internals.h index 22f13dcaddb..e59a4d4eb9c 100644 --- a/mono/metadata/object-internals.h +++ b/mono/metadata/object-internals.h @@ -11,6 +11,7 @@ #include "mono/utils/mono-compiler.h" #include "mono/utils/mono-error.h" #include "mono/utils/mono-stack-unwinding.h" +#include "mono/utils/mono-tls.h" /* * We should find a better place for this stuff. We can't put it in mono-compiler.h, @@ -82,7 +83,7 @@ #endif #define MONO_CHECK_ARG(arg, expr) G_STMT_START{ \ - if (!(expr)) \ + if (G_UNLIKELY (!(expr))) \ { \ MonoException *ex; \ char *msg = g_strdup_printf ("assertion `%s' failed", \ @@ -94,7 +95,7 @@ }; }G_STMT_END #define MONO_CHECK_ARG_NULL(arg) G_STMT_START{ \ - if (arg == NULL) \ + if (G_UNLIKELY (arg == NULL)) \ { \ MonoException *ex; \ if (arg) {} /* check if the name exists */ \ @@ -244,6 +245,8 @@ struct _MonoException { gint32 hresult; MonoString *source; MonoObject *_data; + MonoObject *captured_traces; + MonoArray *native_trace_ips; }; typedef struct { @@ -323,6 +326,7 @@ typedef struct { MonoMarshalByRefObject object; gpointer iunknown; GHashTable* itf_hash; + MonoObject *synchronization_context; } MonoComObject; typedef struct { @@ -364,6 +368,7 @@ typedef struct { typedef enum { MONO_THREAD_FLAG_DONT_MANAGE = 1, // Don't wait for or abort this thread + MONO_THREAD_FLAG_NAME_SET = 2, // Thread name set from managed code } MonoThreadFlags; struct _MonoInternalThread { @@ -371,8 +376,6 @@ struct _MonoInternalThread { volatile int lock_thread_id; /* to be used as the pre-shifted thread id in thin locks. Used for appdomain_ref push/pop */ HANDLE handle; MonoArray *cached_culture_info; - gpointer unused1; - MonoBoolean threadpool_thread; gunichar2 *name; guint32 name_len; guint32 state; @@ -383,34 +386,43 @@ struct _MonoInternalThread { gpointer stack_ptr; gpointer *static_data; gpointer jit_data; - gpointer lock_data; + void *thread_info; /*This is MonoThreadInfo*, but to simplify dependencies, let's make it a void* here. */ MonoAppContext *current_appcontext; - int stack_size; - GSList *appdomain_refs; + MonoException *pending_exception; + MonoThread *root_domain_thread; + MonoObject *_serialized_principal; + int _serialized_principal_version; + gpointer appdomain_refs; /* This is modified using atomic ops, so keep it a gint32 */ gint32 interruption_requested; gpointer suspend_event; gpointer suspended_event; gpointer resume_event; CRITICAL_SECTION *synch_cs; + MonoBoolean threadpool_thread; MonoBoolean thread_dump_requested; - gpointer end_stack; /* This is only used when running in the debugger. */ MonoBoolean thread_interrupt_requested; + gpointer end_stack; /* This is only used when running in the debugger. */ + int stack_size; guint8 apartment_state; gint32 critical_region_level; - guint32 small_id; /* A small, unique id, used for the hazard pointer table. */ + gint32 managed_id; + guint32 small_id; MonoThreadManageCallback manage_callback; - MonoException *pending_exception; - MonoThread *root_domain_thread; gpointer interrupt_on_stop; gsize flags; gpointer android_tid; + gpointer thread_pinning_ref; + gint32 ignore_next_signal; /* * These fields are used to avoid having to increment corlib versions - * when a new field is added to the unmanaged MonoThread structure. + * when a new field is added to this structure. + * Please synchronize any changes with InternalThread in Thread.cs, i.e. add the + * same field there. */ - gpointer unused5; - gpointer unused6; + gpointer unused0; + gpointer unused1; + gpointer unused2; }; struct _MonoThread { @@ -420,12 +432,6 @@ struct _MonoThread { MonoObject *ec_to_set; }; -typedef struct { - MonoString *name; - MonoReflectionType *type; - MonoObject *value; -} MonoSerializationEntry; - typedef struct { guint32 state; MonoObject *additional; @@ -444,24 +450,21 @@ typedef struct { MonoString *LongTimePattern; MonoString *MonthDayPattern; MonoString *YearMonthPattern; - MonoString *FullDateTimePattern; - MonoString *RFC1123Pattern; - MonoString *SortableDateTimePattern; - MonoString *UniversalSortableDateTimePattern; guint32 FirstDayOfWeek; - MonoObject *Calendar; guint32 CalendarWeekRule; MonoArray *AbbreviatedDayNames; MonoArray *DayNames; MonoArray *MonthNames; + MonoArray *GenitiveMonthNames; MonoArray *AbbreviatedMonthNames; + MonoArray *GenitiveAbbreviatedMonthNames; MonoArray *ShortDatePatterns; MonoArray *LongDatePatterns; MonoArray *ShortTimePatterns; MonoArray *LongTimePatterns; MonoArray *MonthDayPatterns; MonoArray *YearMonthPatterns; - MonoArray *shortDayNames; + MonoArray *ShortestDayNames; } MonoDateTimeFormatInfo; typedef struct @@ -512,37 +515,37 @@ typedef struct { MonoBoolean is_read_only; gint32 lcid; gint32 parent_lcid; - gint32 specific_lcid; gint32 datetime_index; gint32 number_index; + gint32 calendar_type; MonoBoolean use_user_override; MonoNumberFormatInfo *number_format; MonoDateTimeFormatInfo *datetime_format; MonoObject *textinfo; MonoString *name; - MonoString *displayname; MonoString *englishname; MonoString *nativename; MonoString *iso3lang; MonoString *iso2lang; - MonoString *icu_name; MonoString *win3lang; MonoString *territory; + MonoArray *native_calendar_names; MonoCompareInfo *compareinfo; - const gint32 *calendar_data; const void* text_info_data; } MonoCultureInfo; typedef struct { MonoObject obj; - gint32 region_id; + gint32 geo_id; MonoString *iso2name; MonoString *iso3name; MonoString *win3name; MonoString *english_name; + MonoString *native_name; MonoString *currency_symbol; MonoString *iso_currency_symbol; MonoString *currency_english_name; + MonoString *currency_native_name; } MonoRegionInfo; typedef struct { @@ -569,16 +572,19 @@ typedef struct { char* (*get_runtime_build_info) (void); gpointer (*get_vtable_trampoline) (int slot_index); gpointer (*get_imt_trampoline) (int imt_slot_index); - void (*set_cast_details) (MonoClass *from, MonoClass *to); + void (*set_cast_details) (MonoClass *from, MonoClass *to); + void (*debug_log) (int level, MonoString *category, MonoString *message); + gboolean (*debug_log_is_enabled) (void); } MonoRuntimeCallbacks; typedef gboolean (*MonoInternalStackWalk) (MonoStackFrameInfo *frame, MonoContext *ctx, gpointer data); typedef struct { void (*mono_walk_stack_with_ctx) (MonoInternalStackWalk func, MonoContext *ctx, MonoUnwindOptions options, void *user_data); - void (*mono_walk_stack_with_state) (MonoInternalStackWalk func, MonoThreadState *state, MonoUnwindOptions options, void *user_data); + void (*mono_walk_stack_with_state) (MonoInternalStackWalk func, MonoThreadUnwindState *state, MonoUnwindOptions options, void *user_data); void (*mono_raise_exception) (MonoException *ex); void (*mono_raise_exception_with_ctx) (MonoException *ex, MonoContext *ctx); + gboolean (*mono_install_handler_block_guard) (MonoThreadUnwindState *unwind_state); } MonoRuntimeExceptionHandlingCallbacks; @@ -654,6 +660,9 @@ mono_install_eh_callbacks (MonoRuntimeExceptionHandlingCallbacks *cbs) MONO_INTE MonoRuntimeExceptionHandlingCallbacks * mono_get_eh_callbacks (void) MONO_INTERNAL; +void +mono_raise_exception_with_context (MonoException *ex, MonoContext *ctx) MONO_INTERNAL; + void mono_type_initialization_init (void) MONO_INTERNAL; @@ -663,13 +672,13 @@ mono_type_initialization_cleanup (void) MONO_INTERNAL; int mono_thread_kill (MonoInternalThread *thread, int signal) MONO_INTERNAL; -guint32 +MonoNativeTlsKey mono_thread_get_tls_key (void) MONO_INTERNAL; gint32 mono_thread_get_tls_offset (void) MONO_INTERNAL; -guint32 +MonoNativeTlsKey mono_domain_get_tls_key (void) MONO_INTERNAL; gint32 @@ -982,7 +991,7 @@ typedef struct { MonoObject *type; MonoArray *pinfo; MonoArray *cattrs; - MonoReflectionMethod *override_method; + MonoArray *override_methods; MonoString *dll; MonoString *dllentry; guint32 charset; @@ -1217,6 +1226,21 @@ typedef struct { MonoArray *data; } MonoReflectionCustomAttr; +typedef struct { + MonoObject object; + MonoString *marshal_cookie; + MonoString *marshal_type; + MonoReflectionType *marshal_type_ref; + MonoReflectionType *marshal_safe_array_user_defined_subtype; + guint32 utype; + guint32 array_subtype; + gint32 safe_array_subtype; + gint32 size_const; + gint32 IidParameterIndex; + gint16 size_param_index; +} MonoReflectionMarshalAsAttribute; + + typedef struct { MonoObject object; gint32 call_conv; @@ -1348,6 +1372,7 @@ void mono_image_module_basic_init (MonoReflectionModuleBuilder *module) void mono_image_register_token (MonoDynamicImage *assembly, guint32 token, MonoObject *obj) MONO_INTERNAL; void mono_dynamic_image_free (MonoDynamicImage *image) MONO_INTERNAL; void mono_image_set_wrappers_type (MonoReflectionModuleBuilder *mb, MonoReflectionType *type) MONO_INTERNAL; +void mono_dynamic_image_release_gc_roots (MonoDynamicImage *image) MONO_INTERNAL; void mono_reflection_setup_internal_class (MonoReflectionTypeBuilder *tb) MONO_INTERNAL; @@ -1380,7 +1405,7 @@ mono_reflection_bind_generic_parameters (MonoReflectionType *type, int type_argc MonoReflectionMethod* mono_reflection_bind_generic_method_parameters (MonoReflectionMethod *method, MonoArray *types) MONO_INTERNAL; void -mono_reflection_generic_class_initialize (MonoReflectionGenericClass *type, MonoArray *methods, MonoArray *ctors, MonoArray *fields, MonoArray *properties, MonoArray *events) MONO_INTERNAL; +mono_reflection_generic_class_initialize (MonoReflectionGenericClass *type, MonoArray *fields) MONO_INTERNAL; MonoReflectionEvent * mono_reflection_event_builder_get_event_info (MonoReflectionTypeBuilder *tb, MonoReflectionEventBuilder *eb) MONO_INTERNAL; @@ -1388,7 +1413,7 @@ MonoArray *mono_reflection_sighelper_get_signature_local (MonoReflectionSigHelp MonoArray *mono_reflection_sighelper_get_signature_field (MonoReflectionSigHelper *sig) MONO_INTERNAL; -MonoReflectionMarshal* mono_reflection_marshal_from_marshal_spec (MonoDomain *domain, MonoClass *klass, MonoMarshalSpec *spec) MONO_INTERNAL; +MonoReflectionMarshalAsAttribute* mono_reflection_marshal_as_attribute_from_marshal_spec (MonoDomain *domain, MonoClass *klass, MonoMarshalSpec *spec) MONO_INTERNAL; gpointer mono_reflection_lookup_dynamic_token (MonoImage *image, guint32 token, gboolean valid_token, MonoClass **handle_class, MonoGenericContext *context) MONO_INTERNAL; @@ -1554,6 +1579,10 @@ mono_object_new_pinned (MonoDomain *domain, MonoClass *klass) MONO_INTERNAL; void mono_field_static_get_value_for_thread (MonoInternalThread *thread, MonoVTable *vt, MonoClassField *field, void *value) MONO_INTERNAL; +/* exported, used by the debugger */ +void * +mono_vtable_get_static_field_data (MonoVTable *vt); + char * mono_string_to_utf8_ignore (MonoString *s) MONO_INTERNAL; @@ -1563,6 +1592,15 @@ mono_string_to_utf8_image_ignore (MonoImage *image, MonoString *s) MONO_INTERNAL char * mono_string_to_utf8_mp_ignore (MonoMemPool *mp, MonoString *s) MONO_INTERNAL; +gboolean +mono_monitor_is_il_fastpath_wrapper (MonoMethod *method) MONO_INTERNAL; + +char * +mono_exception_get_native_backtrace (MonoException *exc) MONO_INTERNAL; + +MonoString * +ves_icall_Mono_Runtime_GetNativeStackTrace (MonoException *exc) MONO_INTERNAL; + #endif /* __MONO_OBJECT_INTERNALS_H__ */