[pypy-svn] r68387 - in pypy/branch/inline-fastpath-malloc/pypy/jit/backend/x86: . test

arigo at codespeak.net arigo at codespeak.net
Tue Oct 13 17:45:34 CEST 2009


Author: arigo
Date: Tue Oct 13 17:45:34 2009
New Revision: 68387

Modified:
   pypy/branch/inline-fastpath-malloc/pypy/jit/backend/x86/assembler.py
   pypy/branch/inline-fastpath-malloc/pypy/jit/backend/x86/test/test_gc_integration.py
Log:
Check and pass the size as argument to the slowpath malloc.


Modified: pypy/branch/inline-fastpath-malloc/pypy/jit/backend/x86/assembler.py
==============================================================================
--- pypy/branch/inline-fastpath-malloc/pypy/jit/backend/x86/assembler.py	(original)
+++ pypy/branch/inline-fastpath-malloc/pypy/jit/backend/x86/assembler.py	Tue Oct 13 17:45:34 2009
@@ -915,6 +915,7 @@
         if push_arg is not None:
             assert push_arg is ecx
             mc.PUSH(ecx)
+        mc.PUSH(imm(size))
         mc.CALL(rel32(slowpath_addr))
         # note that slowpath_addr returns a "long long", or more precisely
         # two results, which end up in eax and edx.
@@ -922,6 +923,9 @@
         # of nursery_free_adr
         if push_arg is not None:
             mc.POP(ecx)
+            mc.POP(ecx)
+        else:
+            mc.ADD(esp, imm(4))
         offset = mc.get_relative_pos() - jmp_adr
         assert 0 < offset <= 127
         mc.overwrite(jmp_adr-1, chr(offset))

Modified: pypy/branch/inline-fastpath-malloc/pypy/jit/backend/x86/test/test_gc_integration.py
==============================================================================
--- pypy/branch/inline-fastpath-malloc/pypy/jit/backend/x86/test/test_gc_integration.py	(original)
+++ pypy/branch/inline-fastpath-malloc/pypy/jit/backend/x86/test/test_gc_integration.py	Tue Oct 13 17:45:34 2009
@@ -175,6 +175,7 @@
         # 64 bytes
         def malloc_slowpath(size):
             from pypy.rlib.rarithmetic import r_ulonglong
+            assert size == 8
             nadr = rffi.cast(lltype.Signed, self.nursery)
             self.addrs[0] = 99999    # should be overridden by the caller
             return ((r_ulonglong(nadr + size) << 32) |     # this part in edx



More information about the Pypy-commit mailing list