[pypy-svn] pypy jit-short-preamble: Ignore failargs when matching ops

hakanardo commits-noreply at bitbucket.org
Mon Jan 10 19:46:46 CET 2011


Author: Hakan Ardo <hakan at debian.org>
Branch: jit-short-preamble
Changeset: r40563:a03d72389500
Date: 2011-01-09 20:21 +0100
http://bitbucket.org/pypy/pypy/changeset/a03d72389500/

Log:	Ignore failargs when matching ops

diff --git a/pypy/jit/metainterp/optimizeopt/unroll.py b/pypy/jit/metainterp/optimizeopt/unroll.py
--- a/pypy/jit/metainterp/optimizeopt/unroll.py
+++ b/pypy/jit/metainterp/optimizeopt/unroll.py
@@ -23,7 +23,8 @@
            self.argmap[inputargs[i]] = jump_args[i]
         self.snapshot_map = {None: None}
 
-    def inline_op(self, newop, ignore_result=False, clone=True):
+    def inline_op(self, newop, ignore_result=False, clone=True,
+                  ignore_failargs=False):
         if clone:
             newop = newop.clone()
         args = newop.getarglist()
@@ -31,8 +32,10 @@
 
         if newop.is_guard():
             args = newop.getfailargs()
-            if args:
+            if args and not ignore_failargs:
                 newop.setfailargs([self.inline_arg(a) for a in args])
+            else:
+                newop.setfailargs([])
 
         if newop.result and not ignore_result:
             old_result = newop.result
@@ -267,7 +270,8 @@
 
             op = preamble_ops[preamble_i]
             try:
-                newop = self.inliner.inline_op(op, True)
+                newop = self.inliner.inline_op(op, ignore_result=True,
+                                               ignore_failargs=True)
             except KeyError:
                 debug_print("create_short_preamble failed due to",
                             "new boxes created during optimization.",


More information about the Pypy-commit mailing list