[pypy-commit] pypy virtual-arguments: JIT improvements

cfbolz noreply at buildbot.pypy.org
Mon Apr 23 11:54:31 CEST 2012


Author: Carl Friedrich Bolz <cfbolz at gmx.de>
Branch: virtual-arguments
Changeset: r54659:63bcd5a3d3af
Date: 2012-04-22 12:55 +0200
http://bitbucket.org/pypy/pypy/changeset/63bcd5a3d3af/

Log:	JIT improvements

diff --git a/pypy/interpreter/argument.py b/pypy/interpreter/argument.py
--- a/pypy/interpreter/argument.py
+++ b/pypy/interpreter/argument.py
@@ -301,7 +301,10 @@
         if num_kwds:
             # kwds_mapping maps target indexes in the scope (minus input_argcount)
             # to positions in the keywords_w list
-            kwds_mapping = [-1] * (co_argcount - input_argcount)
+            kwds_mapping = [0] * (co_argcount - input_argcount)
+            # initialize manually, for the JIT :-(
+            for i in range(len(kwds_mapping)):
+                kwds_mapping[i] = -1
             # match the keywords given at the call site to the argument names
             # the called function takes
             # this function must not take a scope_w, to make the scope not
@@ -332,7 +335,7 @@
                 if kwds_mapping is not None:
                     kwds_index = kwds_mapping[j]
                     j += 1
-                    if kwds_index != -1:
+                    if kwds_index >= 0:
                         scope_w[i] = keywords_w[kwds_index]
                         continue
                 defnum = i - def_first


More information about the pypy-commit mailing list