[reflection] Use coop handles for MonoMethod icalls (#4272)
[mono.git] / mono / metadata / class-internals.h
index 7a1456cbb76c1f763f071c5f840c35fbc00e155c..5ae0374e89a682a275d57d3241b231a49dc9ee39 100644 (file)
@@ -276,8 +276,8 @@ struct _MonoClass {
         * to 1, because we know the instance size now. After that we 
         * 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 */
+
+       /* ALL BITFIELDS 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 */
@@ -434,10 +434,8 @@ int mono_class_interface_match (const uint8_t *bitmap, int id);
 
 #ifdef DISABLE_COM
 #define mono_class_is_com_object(klass) (FALSE)
-#define mono_class_set_is_com_object(klass) do {} while (0)
 #else
 #define mono_class_is_com_object(klass) ((klass)->is_com_object)
-#define mono_class_set_is_com_object(klass) do { (klass)->is_com_object = 1; } while (0)
 #endif
 
 
@@ -1117,13 +1115,13 @@ typedef struct {
 #ifdef DISABLE_REMOTING
 #define mono_class_is_transparent_proxy(klass) (FALSE)
 #define mono_class_is_real_proxy(klass) (FALSE)
-#define mono_object_is_transparent_proxy(object) (FALSE)
 #else
 #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)
 #endif
 
+#define mono_object_is_transparent_proxy(object) (mono_class_is_transparent_proxy (mono_object_class (object)))
+
 
 #define GENERATE_GET_CLASS_WITH_CACHE_DECL(shortname) \
 MonoClass* mono_class_get_##shortname##_class (void);
@@ -1328,6 +1326,9 @@ mono_method_get_vtable_slot (MonoMethod *method);
 int
 mono_method_get_vtable_index (MonoMethod *method);
 
+MonoMethod*
+mono_method_get_base_method (MonoMethod *method, gboolean definition, MonoError *error);
+
 MonoMethod*
 mono_method_search_in_array_class (MonoClass *klass, const char *name, MonoMethodSignature *sig);
 
@@ -1514,6 +1515,9 @@ mono_class_get_declsec_flags (MonoClass *class);
 void
 mono_class_set_declsec_flags (MonoClass *class, guint32 value);
 
+void
+mono_class_set_is_com_object (MonoClass *klass);
+
 /*Now that everything has been defined, let's include the inline functions */
 #include <mono/metadata/class-inlines.h>