[pypy-commit] pypy default: Unroll a function in newformat with constant args. Thanks to Aaron Iles for the patch.

alex_gaynor noreply at buildbot.pypy.org
Mon Mar 12 18:23:47 CET 2012


Author: Alex Gaynor <alex.gaynor at gmail.com>
Branch: 
Changeset: r53325:1b9308ab5b43
Date: 2012-03-12 10:23 -0700
http://bitbucket.org/pypy/pypy/changeset/1b9308ab5b43/

Log:	Unroll a function in newformat with constant args. Thanks to Aaron
	Iles for the patch.

diff --git a/pypy/objspace/std/newformat.py b/pypy/objspace/std/newformat.py
--- a/pypy/objspace/std/newformat.py
+++ b/pypy/objspace/std/newformat.py
@@ -10,6 +10,10 @@
 
 
 @specialize.argtype(1)
+ at jit.look_inside_iff(lambda space, s, start, end:
+       jit.isconstant(s) and
+       jit.isconstant(start) and
+       jit.isconstant(end))
 def _parse_int(space, s, start, end):
     """Parse a number and check for overflows"""
     result = 0


More information about the pypy-commit mailing list