[pypy-commit] pypy jit-duplicated_short_boxes: workaround for now

hakanardo noreply at buildbot.pypy.org
Mon Aug 29 21:21:46 CEST 2011


Author: Hakan Ardo <hakan at debian.org>
Branch: jit-duplicated_short_boxes
Changeset: r46902:09b508a2d84c
Date: 2011-08-29 21:08 +0200
http://bitbucket.org/pypy/pypy/changeset/09b508a2d84c/

Log:	workaround for now

diff --git a/pypy/jit/metainterp/optimizeopt/optimizer.py b/pypy/jit/metainterp/optimizeopt/optimizer.py
--- a/pypy/jit/metainterp/optimizeopt/optimizer.py
+++ b/pypy/jit/metainterp/optimizeopt/optimizer.py
@@ -63,7 +63,7 @@
         else:
             self.lenbound = LenBound(mode, descr, IntLowerBound(val + 1))
 
-    def make_guards(self, box):
+    def make_guards(self, box, ignore_lenbound=False):
         guards = []
         if self.level == LEVEL_CONSTANT:
             op = ResOperation(rop.GUARD_VALUE, [box, self.box], None)
@@ -78,7 +78,7 @@
                 op = ResOperation(rop.GUARD_NONNULL, [box], None)
                 guards.append(op)
             self.intbound.make_guards(box, guards)
-            if self.lenbound:
+            if self.lenbound and not ignore_lenbound:
                 lenbox = BoxInt()
                 if self.lenbound.mode == MODE_ARRAY:
                     op = ResOperation(rop.ARRAYLEN_GC, [box], lenbox, self.lenbound.descr)
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
@@ -162,7 +162,8 @@
                     continue
                 seen[box] = True
                 value = preamble_optimizer.getvalue(box)
-                inputarg_setup_ops.extend(value.make_guards(box))
+                inputarg_setup_ops.extend(value.make_guards(box, ignore_lenbound=True))
+                # FIXME: Use a ValueImporter instead of make_guards                
             for box in short_inputargs:
                 if box in seen:
                     continue


More information about the pypy-commit mailing list