[pypy-svn] r67107 - pypy/branch/pyjitpl5/pypy/jit/backend/x86

arigo at codespeak.net arigo at codespeak.net
Sun Aug 23 12:22:39 CEST 2009


Author: arigo
Date: Sun Aug 23 12:22:38 2009
New Revision: 67107

Modified:
   pypy/branch/pyjitpl5/pypy/jit/backend/x86/assembler.py
   pypy/branch/pyjitpl5/pypy/jit/backend/x86/gc.py
Log:
Also fix gc.py.


Modified: pypy/branch/pyjitpl5/pypy/jit/backend/x86/assembler.py
==============================================================================
--- pypy/branch/pyjitpl5/pypy/jit/backend/x86/assembler.py	(original)
+++ pypy/branch/pyjitpl5/pypy/jit/backend/x86/assembler.py	Sun Aug 23 12:22:38 2009
@@ -236,6 +236,7 @@
         self.mc.PUSH(esi)
         self.mc.PUSH(edi)
         # NB. exactly 4 pushes above; if this changes, fix stack_pos().
+        # You must also keep _get_callshape() in sync.
         self.mc.SUB(esp, imm(framesize * WORD))
         for i in range(len(arglocs)):
             loc = arglocs[i]

Modified: pypy/branch/pyjitpl5/pypy/jit/backend/x86/gc.py
==============================================================================
--- pypy/branch/pyjitpl5/pypy/jit/backend/x86/gc.py	(original)
+++ pypy/branch/pyjitpl5/pypy/jit/backend/x86/gc.py	Sun Aug 23 12:22:38 2009
@@ -232,14 +232,11 @@
         return self._compress_callshape(shape)
 
     def _get_callshape(self, gclocs):
-        # The return address is always found at 4(%ebp); and
-        # the three registers %ebx, %esi, %edi are not used at all
-        # so far, so their value always comes from the caller.
-        shape = [self.LOC_EBP_BASED | 4,
-                 self.LOC_REG | 0,
-                 self.LOC_REG | 4,
-                 self.LOC_REG | 8,
-                 self.LOC_EBP_BASED | 0,
+        shape = [self.LOC_EBP_BASED | 4,     # return addr: at   4(%ebp)
+                 self.LOC_EBP_BASED | (-4),  # saved %ebx:  at  -4(%ebp)
+                 self.LOC_EBP_BASED | (-8),  # saved %esi:  at  -8(%ebp)
+                 self.LOC_EBP_BASED | (-12), # saved %edi:  at -12(%ebp)
+                 self.LOC_EBP_BASED | 0,     # saved %ebp:  at    (%ebp)
                  0]
         for loc in gclocs:
             assert isinstance(loc, MODRM)



More information about the Pypy-commit mailing list