Disable most remoting code under DISABLE_REMOTING.
[mono.git] / mono / mini / mini-trampolines.c
index 50bd275b067533750c396ec319da9d3430fe2d20..fb958386809a9c00339e2810e4a9519e73723ee0 100644 (file)
@@ -771,6 +771,7 @@ mono_vcall_trampoline (mgreg_t *regs, guint8 *code, int slot, guint8 *tramp)
        return common_call_trampoline (regs, code, m, tramp, vt, vtable_slot, need_rgctx_tramp);
 }
 
+#ifndef DISABLE_REMOTING
 gpointer
 mono_generic_virtual_remoting_trampoline (mgreg_t *regs, guint8 *code, MonoMethod *m, guint8 *tramp)
 {
@@ -807,6 +808,7 @@ mono_generic_virtual_remoting_trampoline (mgreg_t *regs, guint8 *code, MonoMetho
 
        return addr;
 }
+#endif
 
 /*
  * mono_aot_trampoline:
@@ -997,14 +999,16 @@ mono_delegate_trampoline (mgreg_t *regs, guint8 *code, gpointer *tramp_data, gui
                 * (ctor_with_method () does this, but it doesn't store the wrapper back into
                 * delegate->method).
                 */
+#ifndef DISABLE_REMOTING
                if (delegate->target && delegate->target->vtable->klass == mono_defaults.transparent_proxy_class) {
 #ifndef DISABLE_COM
                        if (((MonoTransparentProxy *)delegate->target)->remote_class->proxy_class != mono_defaults.com_object_class && 
                           !((MonoTransparentProxy *)delegate->target)->remote_class->proxy_class->is_com_object)
 #endif
                                method = mono_marshal_get_remoting_invoke (method);
-               }
-               else {
+               } else
+#endif
+               {
                        mono_error_init (&err);
                        sig = mono_method_signature_checked (method, &err);
                        if (!sig)
@@ -1181,8 +1185,10 @@ mono_get_trampoline_func (MonoTrampolineType tramp_type)
 #endif
        case MONO_TRAMPOLINE_RESTORE_STACK_PROT:
                return mono_altstack_restore_prot;
+#ifndef DISABLE_REMOTING
        case MONO_TRAMPOLINE_GENERIC_VIRTUAL_REMOTING:
                return mono_generic_virtual_remoting_trampoline;
+#endif
        case MONO_TRAMPOLINE_MONITOR_ENTER:
                return mono_monitor_enter_trampoline;
        case MONO_TRAMPOLINE_MONITOR_EXIT:
@@ -1237,7 +1243,9 @@ mono_trampolines_init (void)
        mono_trampoline_code [MONO_TRAMPOLINE_DELEGATE] = create_trampoline_code (MONO_TRAMPOLINE_DELEGATE);
 #endif
        mono_trampoline_code [MONO_TRAMPOLINE_RESTORE_STACK_PROT] = create_trampoline_code (MONO_TRAMPOLINE_RESTORE_STACK_PROT);
+#ifndef DISABLE_REMOTING
        mono_trampoline_code [MONO_TRAMPOLINE_GENERIC_VIRTUAL_REMOTING] = create_trampoline_code (MONO_TRAMPOLINE_GENERIC_VIRTUAL_REMOTING);
+#endif
        mono_trampoline_code [MONO_TRAMPOLINE_MONITOR_ENTER] = create_trampoline_code (MONO_TRAMPOLINE_MONITOR_ENTER);
        mono_trampoline_code [MONO_TRAMPOLINE_MONITOR_EXIT] = create_trampoline_code (MONO_TRAMPOLINE_MONITOR_EXIT);
        mono_trampoline_code [MONO_TRAMPOLINE_VCALL] = create_trampoline_code (MONO_TRAMPOLINE_VCALL);