[pypy-svn] pypy jitypes2: Phew. Finally got a failing test. The libffi.Func needs to be promoted, which

arigo commits-noreply at bitbucket.org
Sun Mar 27 17:02:18 CEST 2011


Author: Armin Rigo <arigo at tunes.org>
Branch: jitypes2
Changeset: r42984:52d990937d2e
Date: 2011-03-27 17:02 +0200
http://bitbucket.org/pypy/pypy/changeset/52d990937d2e/

Log:	Phew. Finally got a failing test. The libffi.Func needs to be
	promoted, which is done from the code in pypy/module/_ffi, but was
	not done automatically for direct usage.

diff --git a/pypy/rlib/libffi.py b/pypy/rlib/libffi.py
--- a/pypy/rlib/libffi.py
+++ b/pypy/rlib/libffi.py
@@ -294,6 +294,7 @@
         # the optimizer will fail to recognize the pattern and won't turn it
         # into a fast CALL.  Note that "arg = arg.next" is optimized away,
         # assuming that archain is completely virtual.
+        self = jit.hint(self, promote=True)
         if argchain.numargs != len(self.argtypes):
             raise TypeError, 'Wrong number of arguments: %d expected, got %d' %\
                 (argchain.numargs, len(self.argtypes))

diff --git a/pypy/jit/backend/x86/test/test_zrpy_gc.py b/pypy/jit/backend/x86/test/test_zrpy_gc.py
--- a/pypy/jit/backend/x86/test/test_zrpy_gc.py
+++ b/pypy/jit/backend/x86/test/test_zrpy_gc.py
@@ -85,7 +85,7 @@
     if kwds['jit']:
         apply_jit(t, enable_opts=enable_opts)
     cbuilder = genc.CStandaloneBuilder(t, f, t.config)
-    cbuilder.generate_source()
+    cbuilder.generate_source(defines=cbuilder.DEBUG_DEFINES)
     cbuilder.compile()
     return cbuilder
 


More information about the Pypy-commit mailing list