Skip to content

Commit c3569ab

Browse files
committed
rt: Remove some unused stack from i386/morestack.S
1 parent d2e7336 commit c3569ab

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/rt/arch/i386/morestack.S

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -144,11 +144,11 @@ MORESTACK:
144144
// NB: __morestack is called misaligned by 4 bytes, i.e.
145145
// subl $4, %esp would get us to a normal alignment
146146

147-
subl $44,%esp
147+
subl $28,%esp
148148

149149
// Save fastcc arguments
150-
movl %ecx, 28(%esp)
151-
movl %edx, 24(%esp)
150+
movl %ecx, 16(%esp)
151+
movl %edx, 12(%esp)
152152

153153
// FIXME (1226): main is compiled with the split-stack prologue,
154154
// causing it to call __morestack, so we have to jump back out
@@ -160,14 +160,14 @@ MORESTACK:
160160

161161
// The size of the stack arguments to copy to the new stack,
162162
// ane of the the arguments to __morestack
163-
movl 56(%esp),%eax
163+
movl 40(%esp),%eax
164164
movl %eax,8(%esp)
165165
// The address of the stack arguments to the original function
166-
leal 64(%esp),%eax
166+
leal 48(%esp),%eax
167167
movl %eax,4(%esp)
168168
// The amount of stack needed for the original function,
169169
// the other argument to __morestack
170-
movl 52(%esp),%eax // The amount of stack needed
170+
movl 36(%esp),%eax // The amount of stack needed
171171
movl %eax,(%esp)
172172

173173
call UPCALL_NEW_STACK
@@ -176,13 +176,13 @@ MORESTACK:
176176
movl %eax, (%esp)
177177

178178
// Grab the __morestack return pointer
179-
movl 48(%esp),%eax
179+
movl 32(%esp),%eax
180180
// Skip past the ret instruction in the parent fn
181181
inc %eax
182182

183183
// Restore the fastcc arguments to the original function
184-
movl 28(%esp), %ecx
185-
movl 24(%esp), %edx
184+
movl 16(%esp), %ecx
185+
movl 12(%esp), %edx
186186

187187
// Switch stacks
188188
movl (%esp),%esp

0 commit comments

Comments
 (0)