[pypy-commit] pypy unroll-if-alt: small hack, and now passing tests!

alex_gaynor noreply at buildbot.pypy.org
Mon Sep 19 20:22:57 CEST 2011


Author: Alex Gaynor <alex.gaynor at gmail.com>
Branch: unroll-if-alt
Changeset: r47353:7b7294111e91
Date: 2011-09-19 14:22 -0400
http://bitbucket.org/pypy/pypy/changeset/7b7294111e91/

Log:	small hack, and now passing tests!

diff --git a/pypy/rlib/jit.py b/pypy/rlib/jit.py
--- a/pypy/rlib/jit.py
+++ b/pypy/rlib/jit.py
@@ -117,6 +117,8 @@
     """
     def inner(func):
         func_unroll = unroll_safe(func_with_new_name(func, func.__name__ + "_unroll"))
+        if hasattr(func_unroll, "oopspec"):
+            del func_unroll.oopspec
         func = dont_look_inside(func)
         # When we return the new function, it might be specialized in some
         # way. We "propogate" this specialization by using
diff --git a/pypy/rpython/lltypesystem/rlist.py b/pypy/rpython/lltypesystem/rlist.py
--- a/pypy/rpython/lltypesystem/rlist.py
+++ b/pypy/rpython/lltypesystem/rlist.py
@@ -233,12 +233,13 @@
     else:
         _ll_list_resize_really(l, newsize)
 
+ at jit.look_inside_iff(lambda l, newsize: jit.isconstant(len(l.items)) and jit.isconstant(newsize))
+ at jit.oopspec("list._resize_le(l, newsize)")
 def _ll_list_resize_le(l, newsize):
     if newsize >= (len(l.items) >> 1) - 5:
         l.length = newsize
     else:
         _ll_list_resize_really(l, newsize)
-_ll_list_resize_le.oopspec = 'list._resize_le(l, newsize)'
 
 def ll_append_noresize(l, newitem):
     length = l.length


More information about the pypy-commit mailing list