[pypy-commit] pypy default: let the JIT inline into IO, stuff like seek()/etc. are very cheap

alex_gaynor noreply at buildbot.pypy.org
Fri May 31 22:59:37 CEST 2013


Author: Alex Gaynor <alex.gaynor at gmail.com>
Branch: 
Changeset: r64697:9b895ea86405
Date: 2013-05-31 13:59 -0700
http://bitbucket.org/pypy/pypy/changeset/9b895ea86405/

Log:	let the JIT inline into IO, stuff like seek()/etc. are very cheap

diff --git a/pypy/module/pypyjit/policy.py b/pypy/module/pypyjit/policy.py
--- a/pypy/module/pypyjit/policy.py
+++ b/pypy/module/pypyjit/policy.py
@@ -109,7 +109,7 @@
                        'posix', '_socket', '_sre', '_lsprof', '_weakref',
                        '__pypy__', 'cStringIO', '_collections', 'struct',
                        'mmap', 'marshal', '_codecs', 'rctime', 'cppyy',
-                       '_cffi_backend', 'pyexpat', '_continuation']:
+                       '_cffi_backend', 'pyexpat', '_continuation', '_io']:
             if modname == 'pypyjit' and 'interp_resop' in rest:
                 return False
             return True
diff --git a/pypy/module/pypyjit/test/test_policy.py b/pypy/module/pypyjit/test/test_policy.py
--- a/pypy/module/pypyjit/test/test_policy.py
+++ b/pypy/module/pypyjit/test/test_policy.py
@@ -36,6 +36,10 @@
     from pypy.module.rctime.interp_time import time
     assert pypypolicy.look_inside_function(time)
 
+def test_io():
+    from pypy.module._io.interp_bytesio import W_BytesIO
+    assert pypypolicy.look_inside_function(W_BytesIO.seek_w.im_func)
+
 def test_pypy_module():
     from pypy.module._collections.interp_deque import W_Deque
     from pypy.module._random.interp_random import W_Random


More information about the pypy-commit mailing list