[pypy-commit] pypy jit-short_from_state: make sure guards for a box are emited before the box is used

hakanardo noreply at buildbot.pypy.org
Mon Jun 6 14:23:26 CEST 2011


Author: Hakan Ardo <hakan at debian.org>
Branch: jit-short_from_state
Changeset: r44737:5dda9e0ace7f
Date: 2011-06-06 13:22 +0200
http://bitbucket.org/pypy/pypy/changeset/5dda9e0ace7f/

Log:	make sure guards for a box are emited before the box is used

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
@@ -298,7 +298,7 @@
         
         for result, op in self.short_boxes.items():
             if op is not None:
-                for op in self.getvalue(result).make_guards(result):
+                if len(self.getvalue(result).make_guards(result)) > 0:
                     self.add_op_to_short(op, short, short_seen)
 
         self.optimizer.flush()
@@ -369,6 +369,10 @@
             guard = ResOperation(rop.GUARD_NO_OVERFLOW, [], None)
             self.add_op_to_short(guard, short, short_seen)
 
+        if op.result in self.short_boxes:
+            for guard in self.getvalue(op.result).make_guards(op.result):
+                self.add_op_to_short(guard, short, short_seen)
+
         return newop.result
         
     def import_box(self, box, inputargs, short, short_jumpargs,


More information about the pypy-commit mailing list