Author: mprobst
Date: 2007-10-10 06:32:22 -0400 (Wed, 10 Oct 2007)
New Revision: 87249
Modified:
trunk/mono/mono/mini/ChangeLog
trunk/mono/mono/mini/generic-sharing.c
trunk/mono/mono/mini/mini-amd64.c
trunk/mono/mono/mini/mini-x86.c
trunk/mono/mono/mini/mini.h
Log:
2007-10-10 Mark Probst <[EMAIL PROTECTED]>
* generic-sharing.c, mini.h, mini-amd64.c, mini-x86.c: Moved type
variable handling out of arch-specific code.
Modified: trunk/mono/mono/mini/ChangeLog
===================================================================
--- trunk/mono/mono/mini/ChangeLog 2007-10-10 09:43:37 UTC (rev 87248)
+++ trunk/mono/mono/mini/ChangeLog 2007-10-10 10:32:22 UTC (rev 87249)
@@ -1,4 +1,8 @@
+2007-10-10 Mark Probst <[EMAIL PROTECTED]>
+ * generic-sharing.c, mini.h, mini-amd64.c, mini-x86.c: Moved type
+ variable handling out of arch-specific code.
+
Wed Oct 10 10:49:28 CEST 2007 Paolo Molaro <[EMAIL PROTECTED]>
* mini-arm.c: implemented fast delegate dispatch.
Modified: trunk/mono/mono/mini/generic-sharing.c
===================================================================
--- trunk/mono/mono/mini/generic-sharing.c 2007-10-10 09:43:37 UTC (rev
87248)
+++ trunk/mono/mono/mini/generic-sharing.c 2007-10-10 10:32:22 UTC (rev
87249)
@@ -207,3 +207,14 @@
return shared;
}
+
+MonoType*
+mini_get_basic_type_from_generic (MonoCompile *cfg, MonoType *type)
+{
+ if (!type->byref && (type->type == MONO_TYPE_VAR || type->type ==
MONO_TYPE_MVAR)) {
+ /* FIXME: we support sharing only of reference types */
+ g_assert (cfg->generic_shared);
+ return &mono_defaults.object_class->byval_arg;
+ }
+ return type;
+}
Modified: trunk/mono/mono/mini/mini-amd64.c
===================================================================
--- trunk/mono/mono/mini/mini-amd64.c 2007-10-10 09:43:37 UTC (rev 87248)
+++ trunk/mono/mono/mini/mini-amd64.c 2007-10-10 10:32:22 UTC (rev 87249)
@@ -517,6 +517,7 @@
/* return value */
{
ret_type = mono_type_get_underlying_type (sig->ret);
+ ret_type = mini_get_basic_type_from_generic (cfg, ret_type);
switch (ret_type->type) {
case MONO_TYPE_BOOLEAN:
case MONO_TYPE_I1:
@@ -574,12 +575,6 @@
break;
case MONO_TYPE_VOID:
break;
- case MONO_TYPE_VAR:
- case MONO_TYPE_MVAR:
- g_assert (cfg->generic_shared);
- cinfo->ret.storage = ArgInIReg;
- cinfo->ret.reg = AMD64_RAX;
- break;
default:
g_error ("Can't handle as return value 0x%x",
sig->ret->type);
}
@@ -619,6 +614,7 @@
continue;
}
ptype = mono_type_get_underlying_type (sig->params [i]);
+ ptype = mini_get_basic_type_from_generic (cfg, ptype);
switch (ptype->type) {
case MONO_TYPE_BOOLEAN:
case MONO_TYPE_I1:
@@ -668,11 +664,6 @@
case MONO_TYPE_R8:
add_float (&fr, &stack_size, ainfo, TRUE);
break;
- case MONO_TYPE_VAR:
- case MONO_TYPE_MVAR:
- g_assert (cfg->generic_shared);
- add_general (&gr, &stack_size, ainfo);
- break;
default:
g_assert_not_reached ();
}
Modified: trunk/mono/mono/mini/mini-x86.c
===================================================================
--- trunk/mono/mono/mini/mini-x86.c 2007-10-10 09:43:37 UTC (rev 87248)
+++ trunk/mono/mono/mini/mini-x86.c 2007-10-10 10:32:22 UTC (rev 87249)
@@ -258,6 +258,7 @@
/* return value */
{
ret_type = mono_type_get_underlying_type (sig->ret);
+ ret_type = mini_get_basic_type_from_generic (cfg, ret_type);
switch (ret_type->type) {
case MONO_TYPE_BOOLEAN:
case MONO_TYPE_I1:
@@ -314,12 +315,6 @@
case MONO_TYPE_VOID:
cinfo->ret.storage = ArgNone;
break;
- case MONO_TYPE_VAR:
- case MONO_TYPE_MVAR:
- g_assert (cfg->generic_shared);
- cinfo->ret.storage = ArgInIReg;
- cinfo->ret.reg = X86_EAX;
- break;
default:
g_error ("Can't handle as return value 0x%x",
sig->ret->type);
}
@@ -359,6 +354,7 @@
continue;
}
ptype = mono_type_get_underlying_type (sig->params [i]);
+ ptype = mini_get_basic_type_from_generic (cfg, ptype);
switch (ptype->type) {
case MONO_TYPE_BOOLEAN:
case MONO_TYPE_I1:
@@ -408,11 +404,6 @@
case MONO_TYPE_R8:
add_float (&fr, &stack_size, ainfo, TRUE);
break;
- case MONO_TYPE_VAR:
- case MONO_TYPE_MVAR:
- g_assert (cfg->generic_shared);
- add_general (&gr, &stack_size, ainfo);
- break;
default:
g_error ("unexpected type 0x%x", ptype->type);
g_assert_not_reached ();
Modified: trunk/mono/mono/mini/mini.h
===================================================================
--- trunk/mono/mono/mini/mini.h 2007-10-10 09:43:37 UTC (rev 87248)
+++ trunk/mono/mono/mini/mini.h 2007-10-10 10:32:22 UTC (rev 87249)
@@ -1124,5 +1124,6 @@
MonoGenericContext* mono_make_shared_context (MonoCompile *cfg,
MonoGenericContext *context) MONO_INTERNAL;
+MonoType* mini_get_basic_type_from_generic (MonoCompile *cfg, MonoType *type)
MONO_INTERNAL;
#endif /* __MONO_MINI_H__ */
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches