[pypy-commit] pypy ppc-jit-backend: Handle stack alignment in emit_call

hager noreply at buildbot.pypy.org
Fri Nov 4 12:19:50 CET 2011


Author: hager <sven.hager at uni-duesseldorf.de>
Branch: ppc-jit-backend
Changeset: r48744:8157df3c66e8
Date: 2011-11-04 12:18 +0100
http://bitbucket.org/pypy/pypy/changeset/8157df3c66e8/

Log:	Handle stack alignment in emit_call

diff --git a/pypy/jit/backend/ppc/ppcgen/opassembler.py b/pypy/jit/backend/ppc/ppcgen/opassembler.py
--- a/pypy/jit/backend/ppc/ppcgen/opassembler.py
+++ b/pypy/jit/backend/ppc/ppcgen/opassembler.py
@@ -500,6 +500,8 @@
 
         # adjust SP and compute size of parameter save area
         stack_space = 4 * (WORD + len(stack_args))
+        while stack_space % (4 * WORD) != 0:
+            stack_space += 1
         self.mc.stwu(1, 1, -stack_space)
         self.mc.mflr(0)
         self.mc.stw(0, 1, stack_space + WORD)
@@ -507,11 +509,12 @@
         # then we push everything on the stack
         for i, arg in enumerate(stack_args):
             offset = (2 + i) * WORD
-            self.mc.load_imm(r.r0, arg.value)
+            if arg is not None:
+                self.mc.load_imm(r.r0, arg.value)
             if IS_PPC_32:
                 self.mc.stw(r.r0.value, r.SP.value, offset)
             else:
-                assert 0, "not implemented yet"
+                self.mc.std(r.r0.value, r.SP.value, offset)
 
         # collect variables that need to go in registers
         # and the registers they will be stored in 


More information about the pypy-commit mailing list