[pypy-commit] pypy dynamic-specialized-tuple: unroll this so it's actually useful

alex_gaynor noreply at buildbot.pypy.org
Tue Apr 24 04:40:55 CEST 2012


Author: Alex Gaynor <alex.gaynor at gmail.com>
Branch: dynamic-specialized-tuple
Changeset: r54710:10fb8b0fb0df
Date: 2012-04-23 21:56 -0400
http://bitbucket.org/pypy/pypy/changeset/10fb8b0fb0df/

Log:	unroll this so it's actually useful

diff --git a/pypy/objspace/std/tupletype.py b/pypy/objspace/std/tupletype.py
--- a/pypy/objspace/std/tupletype.py
+++ b/pypy/objspace/std/tupletype.py
@@ -4,6 +4,7 @@
 from pypy.interpreter.baseobjspace import W_Root
 from pypy.objspace.std.register_all import register_all
 from pypy.objspace.std.stdtypedef import StdTypeDef, SMM
+from pypy.rlib import jit
 from pypy.rlib.rerased_raw import (UntypedStorage, INT, BOOL, FLOAT, INSTANCE,
     STRING, UNICODE)
 from pypy.rlib.unroll import unrolling_iterable
@@ -89,6 +90,9 @@
             return read(space, storage, idx)
     assert False
 
+ at jit.look_inside_iff(lambda space, w_tuple, list_w:
+    isvirtual(list_w) or (isconstant(len(list_w)) and len(list_w) <= 5)
+)
 def make_tuple(space, w_tuple, list_w):
     from pypy.objspace.std.tupleobject import W_TupleObject
 


More information about the pypy-commit mailing list