Author: Hakan Ardo <[email protected]>
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):
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to