[pypy-svn] r67807 - pypy/trunk/pypy/translator/c/gcc

arigo at codespeak.net arigo at codespeak.net
Sat Sep 19 22:38:24 CEST 2009


Author: arigo
Date: Sat Sep 19 22:38:23 2009
New Revision: 67807

Modified:
   pypy/trunk/pypy/translator/c/gcc/trackgcroot.py
Log:
Obscure.  I am now seeing a "pushw" instruction.  Oh well.


Modified: pypy/trunk/pypy/translator/c/gcc/trackgcroot.py
==============================================================================
--- pypy/trunk/pypy/translator/c/gcc/trackgcroot.py	(original)
+++ pypy/trunk/pypy/translator/c/gcc/trackgcroot.py	Sat Sep 19 22:38:23 2009
@@ -688,6 +688,9 @@
         source = match.group(1)
         return [InsnStackAdjust(-4)] + self.insns_for_copy(source, '0(%esp)')
 
+    def visit_pushw(self, line):
+        return [InsnStackAdjust(-2)]   # rare but not impossible
+
     def _visit_pop(self, target):
         return self.insns_for_copy('0(%esp)', target) + [InsnStackAdjust(+4)]
 
@@ -907,8 +910,8 @@
 class InsnStackAdjust(Insn):
     _args_ = ['delta']
     def __init__(self, delta):
-        assert delta % 4 == 0
-        self.delta = delta
+        assert delta % 2 == 0     # should be "% 4", but there is the special
+        self.delta = delta        # case of 'pushw' to handle
 
 class InsnCannotFollowEsp(InsnStackAdjust):
     def __init__(self):



More information about the Pypy-commit mailing list