info->isprimitive = (type->type >= MONO_TYPE_BOOLEAN) && (type->type <= MONO_TYPE_R8);
}
-static MonoObject*
+static MonoObject *
ves_icall_InternalInvoke (MonoReflectionMethod *method, MonoObject *this, MonoArray *params)
{
MonoMethodSignature *sig = method->method->signature;
for (i = 0; i < params->bounds->length; i++) {
if (sig->params [i]->byref) {
- /* fixme: don't know how to handle this */
- g_assert_not_reached ();
+ /* nothing to do */
}
switch (sig->params [i]->type) {
return mono_runtime_invoke (method->method, this, pa);
}
+static MonoObject *
+ves_icall_InternalExecute (MonoReflectionMethod *method, MonoObject *this, MonoArray *params, MonoArray **outArgs)
+{
+ MonoDomain *domain = mono_domain_get ();
+ MonoMethodSignature *sig = method->method->signature;
+ MonoArray *out_args;
+ MonoObject *result;
+ int i, j, outarg_count = 0;
+
+ for (i = 0; i < params->bounds->length; i++) {
+ if (sig->params [i]->byref)
+ outarg_count++;
+ }
+
+ out_args = mono_array_new (domain, mono_defaults.object_class, outarg_count);
+
+ for (i = 0, j = 0; i < params->bounds->length; i++) {
+ if (sig->params [i]->byref) {
+ gpointer arg;
+ arg = mono_array_get (params, gpointer, i);
+ mono_array_set (out_args, gpointer, j, arg);
+ j++;
+ }
+ }
+
+ /* fixme: handle constructors? */
+ if (!strcmp (method->method->name, ".ctor"))
+ g_assert_not_reached ();
+
+ result = ves_icall_InternalInvoke (method, this, params);
+
+ *outArgs = out_args;
+
+ return result;
+}
+
static MonoObject *
ves_icall_System_Enum_ToObject (MonoReflectionType *type, MonoObject *obj)
{
memcpy (dest_buf, src_buf, count);
}
+static MonoObject *
+ves_icall_Remoting_RealProxy_GetTransparentProxy (MonoObject *this)
+{
+ MonoDomain *domain = mono_domain_get ();
+ MonoObject *res;
+ MonoRealProxy *rp = ((MonoRealProxy *)this);
+ MonoType *type;
+ MonoClass *klass;
+
+ res = mono_object_new (domain, mono_defaults.transparent_proxy_class);
+
+ ((MonoTransparentProxy *)res)->rp = this;
+ type = ((MonoReflectionType *)rp->class_to_proxy)->type;
+ klass = mono_class_from_mono_type (type);
+
+ res->vtable = mono_class_proxy_vtable (domain, klass);
+
+ return res;
+}
+
/* System.Environment */
static MonoString *
return NULL; /* FIXME */
}
+
+void
+ves_icall_MonoMethodMessage_InitMessage (MonoMethodMessage *this,
+ MonoReflectionMethod *method,
+ MonoArray *out_args)
+{
+ MonoDomain *domain = mono_domain_get ();
+ MonoMethodSignature *sig = method->method->signature;
+ MonoString *name;
+ int i, j;
+ char **names;
+ guint8 arg_type;
+
+ this->method = method;
+
+ this->args = mono_array_new (domain, mono_defaults.object_class, sig->param_count);
+ this->arg_types = mono_array_new (domain, mono_defaults.byte_class, sig->param_count);
+
+ names = g_new (char *, sig->param_count);
+ mono_method_get_param_names (method->method, (const char **) names);
+ this->names = mono_array_new (domain, mono_defaults.string_class, sig->param_count);
+
+ for (i = 0; i < sig->param_count; i++) {
+ name = mono_string_new (domain, names [i]);
+ mono_array_set (this->names, gpointer, i, name);
+ }
+
+ g_free (names);
+
+ for (i = 0, j = 0; i < sig->param_count; i++) {
+
+ if (sig->params [i]->byref) {
+ if (out_args) {
+ gpointer arg = mono_array_get (out_args, gpointer, j);
+ mono_array_set (this->args, gpointer, i, arg);
+ j++;
+ }
+ arg_type = 2;
+ if (sig->params [i]->attrs & PARAM_ATTRIBUTE_IN)
+ arg_type = 1;
+ } else {
+ arg_type = 1;
+ }
+
+ mono_array_set (this->arg_types, guint8, i, arg_type);
+ }
+}
+
/* icall map */
static gpointer icall_map [] = {
/*
* Mono.CSharp.Debugger
*/
- "Mono.CSharp.Debugger.MonoSymbolWriter::get_local_type_from_sig", ves_icall_Debugger_MonoSymbolWriter_get_local_type_from_sig,
- "Mono.CSharp.Debugger.MonoSymbolWriter::get_method", ves_icall_Debugger_MonoSymbolWriter_method_from_token,
- "Mono.CSharp.Debugger.DwarfFileWriter::get_type_token", ves_icall_Debugger_DwarfFileWriter_get_type_token,
+ "Mono.CSharp.Debugger.MonoSymbolWriter::get_local_type_from_sig",
+ ves_icall_Debugger_MonoSymbolWriter_get_local_type_from_sig,
+ "Mono.CSharp.Debugger.MonoSymbolWriter::get_method",
+ ves_icall_Debugger_MonoSymbolWriter_method_from_token,
+ "Mono.CSharp.Debugger.DwarfFileWriter::get_type_token",
+ ves_icall_Debugger_DwarfFileWriter_get_type_token,
+
+
+ /*
+ * System.Runtime.Remoting
+ */
+ "System.Runtime.Remoting.RemotingServices::InternalExecute",
+ ves_icall_InternalExecute,
+
+ /*
+ * System.Runtime.Remoting.Messaging
+ */
+ "System.Runtime.Remoting.Messaging.MonoMethodMessage::InitMessage",
+ ves_icall_MonoMethodMessage_InitMessage,
+
+ /*
+ * System.Runtime.Remoting.Proxies
+ */
+ "System.Runtime.Remoting.Proxies.RealProxy::GetTransparentProxy",
+ ves_icall_Remoting_RealProxy_GetTransparentProxy,
/*
* add other internal calls here