Author: zoltan
Date: 2008-02-17 14:02:58 -0500 (Sun, 17 Feb 2008)
New Revision: 95992
Modified:
trunk/mono/mono/mini/ChangeLog
trunk/mono/mono/mini/mini-arm.c
trunk/mono/mono/mini/mini-arm.h
Log:
2008-02-17 Zoltan Varga <[EMAIL PROTECTED]>
* mini-arm.h mini-arm.c: Use cfg->vret_addr instead of cfg->ret.
Modified: trunk/mono/mono/mini/ChangeLog
===================================================================
--- trunk/mono/mono/mini/ChangeLog 2008-02-17 18:04:31 UTC (rev 95991)
+++ trunk/mono/mono/mini/ChangeLog 2008-02-17 19:02:58 UTC (rev 95992)
@@ -1,5 +1,7 @@
2008-02-17 Zoltan Varga <[EMAIL PROTECTED]>
+ * mini-arm.h mini-arm.c: Use cfg->vret_addr instead of cfg->ret.
+
* mini-sparc.c: Use cfg->vret_addr instead of cfg->ret. Name the
MonoCompile
variables 'cfg' instead of 'm' for consistency.
Modified: trunk/mono/mono/mini/mini-arm.c
===================================================================
--- trunk/mono/mono/mini/mini-arm.c 2008-02-17 18:04:31 UTC (rev 95991)
+++ trunk/mono/mono/mini/mini-arm.c 2008-02-17 19:02:58 UTC (rev 95992)
@@ -879,10 +879,7 @@
offset = 0;
curinst = 0;
- if (MONO_TYPE_ISSTRUCT (sig->ret)) {
- m->ret->opcode = OP_REGVAR;
- m->ret->inst_c0 = ARMREG_R0;
- } else {
+ if (!MONO_TYPE_ISSTRUCT (sig->ret)) {
/* FIXME: handle long and FP values */
switch (mono_type_get_underlying_type (sig->ret)->type) {
case MONO_TYPE_VOID:
@@ -921,12 +918,16 @@
}
if (MONO_TYPE_ISSTRUCT (sig->ret)) {
- inst = m->ret;
+ inst = m->vret_addr;
offset += sizeof(gpointer) - 1;
offset &= ~(sizeof(gpointer) - 1);
inst->inst_offset = offset;
inst->opcode = OP_REGOFFSET;
inst->inst_basereg = frame_reg;
+ if (G_UNLIKELY (m->verbose_level > 1)) {
+ printf ("vret_addr =");
+ mono_print_ins (m->vret_addr);
+ }
offset += sizeof(gpointer);
if (sig->call_convention == MONO_CALL_VARARG)
m->sig_cookie += sizeof (gpointer);
@@ -1005,10 +1006,22 @@
}
-/* Fixme: we need an alignment solution for enter_method and
mono_arch_call_opcode,
- * currently alignment in mono_arch_call_opcode is computed without
arch_get_argument_info
- */
+void
+mono_arch_create_vars (MonoCompile *cfg)
+{
+ MonoMethodSignature *sig;
+ sig = mono_method_signature (cfg->method);
+
+ if (MONO_TYPE_ISSTRUCT (sig->ret)) {
+ cfg->vret_addr = mono_compile_create_var (cfg,
&mono_defaults.int_class->byval_arg, OP_ARG);
+ if (G_UNLIKELY (cfg->verbose_level > 1)) {
+ printf ("vret_addr = ");
+ mono_print_ins (cfg->vret_addr);
+ }
+ }
+}
+
/*
* take the arguments and generate the arch-specific
* instructions to properly call the function in call.
@@ -3252,7 +3265,7 @@
if (MONO_TYPE_ISSTRUCT (sig->ret)) {
ArgInfo *ainfo = &cinfo->ret;
- inst = cfg->ret;
+ inst = cfg->vret_addr;
g_assert (arm_is_imm12 (inst->inst_offset));
ARM_STR_IMM (code, ainfo->reg, inst->inst_basereg,
inst->inst_offset);
}
Modified: trunk/mono/mono/mini/mini-arm.h
===================================================================
--- trunk/mono/mono/mini/mini-arm.h 2008-02-17 18:04:31 UTC (rev 95991)
+++ trunk/mono/mono/mini/mini-arm.h 2008-02-17 19:02:58 UTC (rev 95992)
@@ -116,6 +116,7 @@
#define MONO_ARCH_COMMON_VTABLE_TRAMPOLINE 1
#define MONO_ARCH_ENABLE_NORMALIZE_OPCODES 1
+#define MONO_ARCH_HAVE_CREATE_VARS 1
#define ARM_NUM_REG_ARGS (ARM_LAST_ARG_REG-ARM_FIRST_ARG_REG+1)
#define ARM_NUM_REG_FPARGS 0
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches