Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Wrap MonoVTable::remote into a pair of accessors to make it easy to h…

…ave code linked out.
  • Loading branch information...
commit 54ab0bf56c6c2bf59bcff74c32be7421f74c5489 1 parent 143d99e
Rodrigo Kumpera authored March 12, 2013
4  mono/metadata/class-internals.h
@@ -421,9 +421,13 @@ int mono_class_interface_match (const uint8_t *bitmap, int id) MONO_INTERNAL;
421 421
 #ifdef DISABLE_REMOTING
422 422
 #define mono_class_is_marshalbyref(klass) (FALSE)
423 423
 #define mono_class_is_contextbound(klass) (FALSE)
  424
+#define mono_vtable_is_remote(vtable) (FALSE)
  425
+#define mono_vtable_set_is_remote(vtable,enable) do {} while (0)
424 426
 #else
425 427
 #define mono_class_is_marshalbyref(klass) ((klass)->marshalbyref)
426 428
 #define mono_class_is_contextbound(klass) ((klass)->contextbound)
  429
+#define mono_vtable_is_remote(vtable) ((vtable)->remote)
  430
+#define mono_vtable_set_is_remote(vtable,enable) do { (vtable)->remote = enable ? 1 : 0; } while (0)
427 431
 #endif
428 432
 
429 433
 #ifdef DISABLE_COM
3  mono/metadata/icall.c
@@ -6829,8 +6829,7 @@ ves_icall_System_Runtime_Activation_ActivationServices_EnableProxyActivation (Mo
6829 6829
 	klass = mono_class_from_mono_type (type->type);
6830 6830
 	vtable = mono_class_vtable_full (mono_domain_get (), klass, TRUE);
6831 6831
 
6832  
-	if (enable) vtable->remote = 1;
6833  
-	else vtable->remote = 0;
  6832
+	mono_vtable_set_is_remote (vtable, enable);
6834 6833
 }
6835 6834
 #endif
6836 6835
 
2  mono/metadata/marshal.c
@@ -3077,7 +3077,7 @@ mono_marshal_get_remoting_invoke (MonoMethod *method)
3077 3077
 		MonoVTable *vtable = mono_class_vtable (mono_domain_get (), method->klass);
3078 3078
 		g_assert (vtable); /*FIXME do proper error handling*/
3079 3079
 
3080  
-		if (!vtable->remote) {
  3080
+		if (!mono_vtable_is_remote (vtable)) {
3081 3081
 			return mono_cominterop_get_invoke (method);
3082 3082
 		}
3083 3083
 	}
11  mono/metadata/object.c
@@ -2113,10 +2113,7 @@ mono_class_create_runtime_vtable (MonoDomain *domain, MonoClass *class, gboolean
2113 2113
 			MONO_GC_REGISTER_ROOT_IF_MOVING(vt->type);
2114 2114
 	}
2115 2115
 
2116  
-	if (mono_class_is_contextbound (class))
2117  
-		vt->remote = 1;
2118  
-	else
2119  
-		vt->remote = 0;
  2116
+	mono_vtable_set_is_remote (vt, mono_class_is_contextbound (class));
2120 2117
 
2121 2118
 	/*  class_vtable_array keeps an array of created vtables
2122 2119
 	 */
@@ -2629,8 +2626,8 @@ mono_remote_class_vtable (MonoDomain *domain, MonoRemoteClass *remote_class, Mon
2629 2626
 		MonoClass *klass;
2630 2627
 		type = ((MonoReflectionType *)rp->class_to_proxy)->type;
2631 2628
 		klass = mono_class_from_mono_type (type);
2632  
-#ifndef DISABLE_COM
2633  
-		if ((mono_class_is_com_object (klass) || (mono_defaults.com_object_class && klass == mono_defaults.com_object_class)) && !mono_class_vtable (mono_domain_get (), klass)->remote)
  2629
+#ifndef DISABLE_COMf
  2630
+		if ((mono_class_is_com_object (klass) || (mono_defaults.com_object_class && klass == mono_defaults.com_object_class)) && !mono_vtable_is_remote (mono_class_vtable (mono_domain_get (), klass)))
2634 2631
 			remote_class->default_vtable = mono_class_proxy_vtable (domain, remote_class, MONO_REMOTING_TARGET_COMINTEROP);
2635 2632
 		else
2636 2633
 #endif
@@ -4428,7 +4425,7 @@ mono_object_new_specific (MonoVTable *vtable)
4428 4425
 	MONO_ARCH_SAVE_REGS;
4429 4426
 	
4430 4427
 	/* check for is_com_object for COM Interop */
4431  
-	if (vtable->remote || mono_class_is_com_object (vtable->klass))
  4428
+	if (mono_vtable_is_remote (vtable) || mono_class_is_com_object (vtable->klass))
4432 4429
 	{
4433 4430
 		gpointer pa [1];
4434 4431
 		MonoMethod *im = vtable->domain->create_proxy_for_type_method;

0 notes on commit 54ab0bf

Please sign in to comment.
Something went wrong with that request. Please try again.