[pypy-commit] pypy default: (fijal, arigo) A partial revert of 1e4c74e007f4, reintroduce emitting of

fijal noreply at buildbot.pypy.org
Sun Dec 25 17:06:18 CET 2011


Author: Maciej Fijalkowski <fijall at gmail.com>
Branch: 
Changeset: r50853:05c2089f5545
Date: 2011-12-25 18:05 +0200
http://bitbucket.org/pypy/pypy/changeset/05c2089f5545/

Log:	(fijal, arigo) A partial revert of 1e4c74e007f4, reintroduce
	emitting of same_as if some optimizations did not produce the same
	boxes.

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
@@ -265,7 +265,13 @@
                     self.optimizer.importable_values[value] = imp
                 newvalue = self.optimizer.getvalue(op.result)
                 newresult = newvalue.get_key_box()
-                assert newresult is op.result or newvalue.is_constant()
+                # note that emitting here SAME_AS should not happen, but
+                # in case it does, we would prefer to be suboptimal in asm
+                # to a fatal RPython exception.
+                if newresult is not op.result and not newvalue.is_constant():
+                    self.short_boxes.alias(newresult, op.result)
+                    op = ResOperation(rop.SAME_AS, [op.result], newresult)
+                    self.optimizer._newoperations = [op] + self.optimizer._newoperations
         self.optimizer.flush()
         self.optimizer.emitting_dissabled = False
 


More information about the pypy-commit mailing list