[pypy-commit] pypy jit-targets: aliasing vrituals are pointless except that it generates a crash

hakanardo noreply at buildbot.pypy.org
Mon Nov 28 21:01:25 CET 2011


Author: Hakan Ardo <hakan at debian.org>
Branch: jit-targets
Changeset: r49933:c5de3f7beba8
Date: 2011-11-28 21:00 +0100
http://bitbucket.org/pypy/pypy/changeset/c5de3f7beba8/

Log:	aliasing vrituals are pointless except that it generates a crash

diff --git a/pypy/jit/metainterp/optimizeopt/test/test_optimizeopt.py b/pypy/jit/metainterp/optimizeopt/test/test_optimizeopt.py
--- a/pypy/jit/metainterp/optimizeopt/test/test_optimizeopt.py
+++ b/pypy/jit/metainterp/optimizeopt/test/test_optimizeopt.py
@@ -7027,6 +7027,20 @@
         """
         self.optimize_loop(ops, expected)
 
+    def test_duplicated_aliased_virtual(self):
+        ops = """
+        [p1, p2]
+        p3 = new_with_vtable(ConstClass(node_vtable))
+        setfield_gc(p3, p3, descr=nextdescr)
+        p4 = getfield_gc(p3, descr=nextdescr)
+        jump(p3, p4)
+        """
+        expected = """
+        []
+        jump()
+        """
+        self.optimize_loop(ops, expected)
+
     def test_chained_virtuals(self):
         ops = """
         [p0, p1]
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
@@ -149,7 +149,7 @@
 
         short_boxes = ShortBoxes(self.optimizer, inputargs + constant_inputargs.keys())
         for i in range(len(original_jump_args)):
-            if original_jump_args[i] is not jump_args[i]:
+            if original_jump_args[i] is not jump_args[i] and not values[i].is_virtual():
                 short_boxes.alias(original_jump_args[i], jump_args[i])
 
         self.optimizer.clear_newoperations()


More information about the pypy-commit mailing list