[pypy-commit] pypy jit-usable_retrace_3: only clone Const's

hakanardo noreply at buildbot.pypy.org
Tue Oct 23 21:08:05 CEST 2012


Author: Hakan Ardo <hakan at debian.org>
Branch: jit-usable_retrace_3
Changeset: r58382:d57bced28c45
Date: 2012-10-23 14:46 +0200
http://bitbucket.org/pypy/pypy/changeset/d57bced28c45/

Log:	only clone Const's

diff --git a/pypy/jit/metainterp/optimizeopt/virtualstate.py b/pypy/jit/metainterp/optimizeopt/virtualstate.py
--- a/pypy/jit/metainterp/optimizeopt/virtualstate.py
+++ b/pypy/jit/metainterp/optimizeopt/virtualstate.py
@@ -382,14 +382,11 @@
                 return # It is enough if we can generate guards to make states compatibe, FIXME: rename method
             except InvalidLoop:
                 pass
-            if value.is_constant():
-                op = ResOperation(rop.SAME_AS, [box], box.clonebox())
-                #optimizer._newoperations.append(op) FIXME
-                return optimizer.getvalue(op.result)
-            else:
-                v = OptValue(box)
-                optimizer.make_equal_to(box, v, True)
-                return v
+            if isinstance(box, Const):
+                box = box.clonebox()
+            v = OptValue(box)
+            optimizer.make_equal_to(box, v, True)
+            return v
 
     def _generate_guards(self, other, box, cpu, extra_guards):
         if not isinstance(other, NotVirtualStateInfo):


More information about the pypy-commit mailing list