[pypy-svn] r66951 - pypy/branch/asmgcc-mingw32/pypy/translator/c/gcc
afa at codespeak.net
afa at codespeak.net
Tue Aug 18 23:26:25 CEST 2009
Author: afa
Date: Tue Aug 18 23:26:24 2009
New Revision: 66951
Modified:
pypy/branch/asmgcc-mingw32/pypy/translator/c/gcc/trackgcroot.py
Log:
Handle __stdcall calling convention. More functions pass
Modified: pypy/branch/asmgcc-mingw32/pypy/translator/c/gcc/trackgcroot.py
==============================================================================
--- pypy/branch/asmgcc-mingw32/pypy/translator/c/gcc/trackgcroot.py (original)
+++ pypy/branch/asmgcc-mingw32/pypy/translator/c/gcc/trackgcroot.py Tue Aug 18 23:26:24 2009
@@ -742,8 +742,15 @@
if lineoffset >= 0:
assert lineoffset in (1,2)
return [InsnStackAdjust(-4)]
- return [InsnCall(self.currentlineno),
- InsnSetLocal('%eax')] # the result is there
+ insns = [InsnCall(self.currentlineno),
+ InsnSetLocal('%eax')] # the result is there
+ if sys.platform == 'win32':
+ # handle __stdcall calling convention:
+ # Stack cleanup is performed by the called function,
+ # Function name is decorated with "@N" where N is the stack size
+ if match and '@' in target:
+ insns.append(InsnStackAdjust(int(target.split('@')[1])))
+ return insns
class UnrecognizedOperation(Exception):
More information about the Pypy-commit
mailing list