Lines 1-76
Link Here
|
1 |
|
|
|
2 |
$FreeBSD: ports/lang/mono/files/patch-mono_mini_mini-x86.c,v 1.3 2009/06/22 07:55:47 flz Exp $ |
3 |
|
4 |
--- mono/mini/mini-x86.c.orig |
5 |
+++ mono/mini/mini-x86.c |
6 |
@@ -1068,26 +1068,15 @@ |
7 |
} |
8 |
|
9 |
if (sig->ret && MONO_TYPE_ISSTRUCT (sig->ret)) { |
10 |
- MonoInst *vtarg; |
11 |
- |
12 |
if (cinfo->ret.storage == ArgValuetypeInReg) { |
13 |
- if (cinfo->ret.pair_storage [0] == ArgInIReg && cinfo->ret.pair_storage [1] == ArgNone) { |
14 |
/* |
15 |
* Tell the JIT to use a more efficient calling convention: call using |
16 |
* OP_CALL, compute the result location after the call, and save the |
17 |
* result there. |
18 |
*/ |
19 |
call->vret_in_reg = TRUE; |
20 |
- } else { |
21 |
- /* |
22 |
- * The valuetype is in EAX:EDX after the call, needs to be copied to |
23 |
- * the stack. Save the address here, so the call instruction can |
24 |
- * access it. |
25 |
- */ |
26 |
- MONO_INST_NEW (cfg, vtarg, OP_X86_PUSH); |
27 |
- vtarg->sreg1 = call->vret_var->dreg; |
28 |
- MONO_ADD_INS (cfg->cbb, vtarg); |
29 |
- } |
30 |
+ if (call->vret_var) |
31 |
+ NULLIFY_INS (call->vret_var); |
32 |
} |
33 |
} |
34 |
|
35 |
@@ -1802,9 +1791,6 @@ |
36 |
static guint8* |
37 |
emit_move_return_value (MonoCompile *cfg, MonoInst *ins, guint8 *code) |
38 |
{ |
39 |
- CallInfo *cinfo; |
40 |
- int quad; |
41 |
- |
42 |
/* Move return value to the target register */ |
43 |
switch (ins->opcode) { |
44 |
case OP_CALL: |
45 |
@@ -1813,31 +1799,6 @@ |
46 |
if (ins->dreg != X86_EAX) |
47 |
x86_mov_reg_reg (code, ins->dreg, X86_EAX, 4); |
48 |
break; |
49 |
- case OP_VCALL: |
50 |
- case OP_VCALL_REG: |
51 |
- case OP_VCALL_MEMBASE: |
52 |
- case OP_VCALL2: |
53 |
- case OP_VCALL2_REG: |
54 |
- case OP_VCALL2_MEMBASE: |
55 |
- cinfo = get_call_info (cfg->generic_sharing_context, cfg->mempool, ((MonoCallInst*)ins)->signature, FALSE); |
56 |
- if (cinfo->ret.storage == ArgValuetypeInReg) { |
57 |
- /* Pop the destination address from the stack */ |
58 |
- x86_pop_reg (code, X86_ECX); |
59 |
- |
60 |
- for (quad = 0; quad < 2; quad ++) { |
61 |
- switch (cinfo->ret.pair_storage [quad]) { |
62 |
- case ArgInIReg: |
63 |
- g_assert (cinfo->ret.pair_regs [quad] != X86_ECX); |
64 |
- x86_mov_membase_reg (code, X86_ECX, (quad * sizeof (gpointer)), cinfo->ret.pair_regs [quad], sizeof (gpointer)); |
65 |
- break; |
66 |
- case ArgNone: |
67 |
- break; |
68 |
- default: |
69 |
- g_assert_not_reached (); |
70 |
- } |
71 |
- } |
72 |
- } |
73 |
- break; |
74 |
case OP_FCALL: { |
75 |
MonoCallInst *call = (MonoCallInst*)ins; |
76 |
if (call->method && !mono_method_signature (call->method)->ret->byref && mono_method_signature (call->method)->ret->type == MONO_TYPE_R4) { |