1 --- mono-1.1.17/mono/arch/alpha/tramp.c.orig 2006-08-25 21:35:19.000000000 +0200
2 +++ mono-1.1.17/mono/arch/alpha/tramp.c 2006-08-30 12:00:25.805971000 +0200
6 static inline unsigned int *
7 -emit_store_return_default(unsigned int *pi, const gint SIZE )
8 +emit_store_return_default(unsigned int *pi, const gint SIZE, MonoMethodSignature *sig )
11 unsigned int *p = (unsigned int *)pi;
15 /* TODO: This probably do different stuff based on the value.
16 you know, like stq/l/w. and s/f.
18 alpha_ldq( p, alpha_t0, alpha_fp, (SIZE-8) ); // load void * retval
19 - alpha_stq( p, alpha_v0, alpha_t0, 0 ); // store the result to *retval.
20 + /* XXX: may need more variants */
21 + if (sig->ret->byref) {
22 + alpha_stq( p, alpha_v0, alpha_t0, 0 ); // store the result to *retval.
24 + simpletype = sig->ret->type;
25 + if ((simpletype == MONO_TYPE_VALUETYPE) && sig->ret->data.klass->enumtype) {
26 + simpletype = sig->ret->data.klass->enum_basetype->type;
28 + switch(simpletype) {
29 + case MONO_TYPE_BOOLEAN:
32 + case MONO_TYPE_CHAR:
35 + case MONO_TYPE_VOID:
42 + case MONO_TYPE_CLASS:
43 + case MONO_TYPE_OBJECT:
44 + case MONO_TYPE_SZARRAY:
45 + case MONO_TYPE_ARRAY:
46 + case MONO_TYPE_STRING:
47 + alpha_stq( p, alpha_v0, alpha_t0, 0 ); // store the result to *retval.
51 + alpha_stt( p, alpha_fv0, alpha_t0, 0 ); // store the result to *retval.
54 + g_error ("Can't handle as return value 0x%x", sig->ret->type);
66 - // floating point... Maybe this does the correct thing.
68 + // floating point; both types use double C type in mono
69 + if( i >= alpharegs )
71 - alpha_ldq( p, alpha_t1, alpha_t0, ARG_LOC( i ) );
72 - alpha_cpys( p, alpha_ft1, alpha_ft1, alpha_ft2 );
73 - alpha_stt( p, alpha_ft2, alpha_sp, pos );
74 + // load into temp register, then store on the stack
75 + alpha_ldt( p, alpha_ft1, alpha_t0, ARG_LOC( i ) );
76 + alpha_stt( p, alpha_ft1, alpha_sp, pos );
81 - alpha_ldq( p, alpha_t1, alpha_t0, ARG_LOC(i) );
82 - alpha_cpys( p, alpha_ft1, alpha_ft1, alpha_fa0 + i + hasthis );
83 + // load into register
84 + // (float regs are numbered in the same way as integer ones,
85 + // so we can abuse regbase)
86 + alpha_ldt( p, regbase + i, alpha_t0, ARG_LOC(i) );
90 case MONO_TYPE_VALUETYPE:
91 g_error ("Not implemented: ValueType as parameter to delegate." );
95 // Now call the function and store the return parameter.
96 p = emit_call( p, STACK_SIZE );
97 - p = emit_store_return_default( p, STACK_SIZE );
98 + p = emit_store_return_default( p, STACK_SIZE, sig );
99 p = emit_epilog( p, STACK_SIZE );
101 if( p > buffer + BUFFER_SIZE )