@@ -61,6 +61,9 @@ MORESTACK:
61
61
.cfi_def_cfa_register %ebp
62
62
#endif
63
63
64
+ // NB: This can be called with the fastcc convention so we
65
+ // have to preserve any argument registers we want to use
66
+
64
67
// FIXME (1226): main is compiled with the split-stack prologue,
65
68
// causing it to call __morestack, so we have to jump back out
66
69
subl $28 ,%esp
@@ -94,9 +97,9 @@ MORESTACK:
94
97
95
98
#ifdef __APPLE__
96
99
call 1f
97
- 1: popl %ebx
98
- movl L_upcall_new_stack$non_lazy_ptr-1b(%ebx ),%ecx
99
- movl %ecx , 4 (%esp )
100
+ 1: popl %eax
101
+ movl L_upcall_new_stack$non_lazy_ptr-1b(%eax ),%eax
102
+ movl %eax , 4 (%esp )
100
103
#else
101
104
movl $UPCALL_NEW_STACK,4 (%esp )
102
105
#endif
@@ -105,11 +108,11 @@ MORESTACK:
105
108
movl %eax ,(%esp )
106
109
call UPCALL_CALL_C
107
110
108
- movl 32 (%esp ),%edx // Grab the return pointer.
109
- inc %edx // Skip past the ret instruction in the parent fn
111
+ movl 32 (%esp ),%eax // Grab the return pointer.
112
+ inc %eax // Skip past the ret instruction in the parent fn
110
113
111
114
movl 8 (%esp ),%esp // Switch stacks.
112
- call *%edx // Re-enter the function that called us.
115
+ call *%eax // Re-enter the function that called us.
113
116
114
117
// Now the function that called us has returned, so we need to delete the
115
118
// old stack space.
@@ -121,9 +124,9 @@ MORESTACK:
121
124
122
125
#ifdef __APPLE__
123
126
call 1f
124
- 1: popl %ebx
125
- movl L_upcall_del_stack$non_lazy_ptr-1b(%ebx ),%ecx
126
- pushl %ecx
127
+ 1: popl %eax
128
+ movl L_upcall_del_stack$non_lazy_ptr-1b(%eax ),%eax
129
+ pushl %eax
127
130
#else
128
131
pushl $UPCALL_DEL_STACK
129
132
#endif
@@ -141,14 +144,14 @@ MORESTACK:
141
144
retl $8
142
145
143
146
.L$bail:
144
- movl 32 (%esp ),%edx
145
- inc %edx
147
+ movl 32 (%esp ),%eax
148
+ inc %eax
146
149
147
150
addl $28 , %esp
148
151
popl %ebp
149
152
addl $4 +8 ,%esp
150
153
151
- jmpl *%edx
154
+ jmpl *%eax
152
155
153
156
#if defined(__linux__) || defined(__APPLE__)
154
157
.cfi_endproc
0 commit comments