Author: Armin Rigo <ar...@tunes.org>
Branch: continulet-jit-2
Changeset: r53059:17f7f5edd8a7
Date: 2012-03-01 16:46 +0100
http://bitbucket.org/pypy/pypy/changeset/17f7f5edd8a7/

Log:    CALLs with a large number of arguments.

diff --git a/pypy/jit/backend/x86/assembler.py 
b/pypy/jit/backend/x86/assembler.py
--- a/pypy/jit/backend/x86/assembler.py
+++ b/pypy/jit/backend/x86/assembler.py
@@ -1129,6 +1129,12 @@
                 else:
                     pass_on_stack.append(loc)
 
+        extra_esp = 0
+        if len(pass_on_stack) > OFFSTACK_REAL_FRAME:
+            extra_esp = WORD * align_stack_words(len(pass_on_stack) -
+                                                 OFFSTACK_REAL_FRAME)
+            self.mc.SUB_ri(esp.value, extra_esp)
+
         # Emit instructions to pass the stack arguments
         # XXX: Would be nice to let remap_frame_layout take care of this, but
         # we'd need to create something like StackLoc, but relative to esp,
@@ -1165,10 +1171,13 @@
             x = r10
         remap_frame_layout(self, src_locs, dst_locs, X86_64_SCRATCH_REG)
 
-        self._regalloc.reserve_param(len(pass_on_stack))
+        #self._regalloc.reserve_param(len(pass_on_stack))
         self.mc.CALL(x)
         self.mark_gc_roots(force_index)
 
+        if extra_esp > 0:
+            self.mc.ADD_ri(esp.value, extra_esp)
+
     def call(self, addr, args, res):
         force_index = self.write_new_force_index()
         self._emit_call(force_index, imm(addr), args)
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to