[pypy-commit] pypy default: Also unroll this function sometimes
alex_gaynor
noreply at buildbot.pypy.org
Sat Dec 1 21:54:16 CET 2012
Author: Alex Gaynor <alex.gaynor at gmail.com>
Branch:
Changeset: r59186:74d7def3be80
Date: 2012-12-01 12:54 -0800
http://bitbucket.org/pypy/pypy/changeset/74d7def3be80/
Log: Also unroll this function sometimes
diff --git a/pypy/module/_sre/interp_sre.py b/pypy/module/_sre/interp_sre.py
--- a/pypy/module/_sre/interp_sre.py
+++ b/pypy/module/_sre/interp_sre.py
@@ -43,13 +43,15 @@
raise SystemError
return w_default
+
+ at jit.look_inside_iff(lambda ctx, num_groups: jit.isconstant(num_groups))
def do_flatten_marks(ctx, num_groups):
# Returns a list of RPython-level integers.
# Unlike the app-level groups() method, groups are numbered from 0
# and the returned list does not start with the whole match range.
if num_groups == 0:
return None
- result = [-1] * (2*num_groups)
+ result = [-1] * (2 * num_groups)
mark = ctx.match_marks
while mark is not None:
index = mark.gid
More information about the pypy-commit
mailing list