[pypy-commit] pypy dynamic-specialized-tuple: unroll this sometimes
alex_gaynor
noreply at buildbot.pypy.org
Wed Apr 25 15:57:38 CEST 2012
Author: Alex Gaynor <alex.gaynor at gmail.com>
Branch: dynamic-specialized-tuple
Changeset: r54748:41a3b45ba449
Date: 2012-04-25 09:57 -0400
http://bitbucket.org/pypy/pypy/changeset/41a3b45ba449/
Log: unroll this sometimes
diff --git a/pypy/objspace/std/tupleobject.py b/pypy/objspace/std/tupleobject.py
--- a/pypy/objspace/std/tupleobject.py
+++ b/pypy/objspace/std/tupleobject.py
@@ -34,6 +34,9 @@
def __init__(self, tuplestorage):
self.tuplestorage = tuplestorage
+ @jit.look_inside_iff(lambda self, space:
+ jit.isvirtual(self) or (jit.isconstant(self.length()) and self.length < UNROLL_TUPLE_LIMIT)
+ )
def tolist(self, space):
items_w = [None] * self.length()
for i in xrange(self.length()):
More information about the pypy-commit
mailing list