[pypy-svn] r78535 - pypy/branch/jit-unroll-loops/pypy/jit/metainterp/test

hakanardo at codespeak.net hakanardo at codespeak.net
Sat Oct 30 17:23:16 CEST 2010


Author: hakanardo
Date: Sat Oct 30 17:23:14 2010
New Revision: 78535

Modified:
   pypy/branch/jit-unroll-loops/pypy/jit/metainterp/test/test_optimizeopt.py
Log:
fixed tests

Modified: pypy/branch/jit-unroll-loops/pypy/jit/metainterp/test/test_optimizeopt.py
==============================================================================
--- pypy/branch/jit-unroll-loops/pypy/jit/metainterp/test/test_optimizeopt.py	(original)
+++ pypy/branch/jit-unroll-loops/pypy/jit/metainterp/test/test_optimizeopt.py	Sat Oct 30 17:23:14 2010
@@ -1231,8 +1231,22 @@
         setarrayitem_gc(p1, 0, i1, descr=arraydescr)
         jump(i1, p1, p2)
         """
+        preamble = """
+        [i1, p2, p3]
+        i3 = getarrayitem_gc(p3, 0, descr=arraydescr)
+        escape(i3)
+        jump(i1, p2)
+        """
+        expected = """
+        [i1, p2]
+        i3 = getarrayitem_gc(p2, 0, descr=arraydescr)
+        escape(i3)
+        p1 = new_array(1, descr=arraydescr)
+        setarrayitem_gc(p1, 0, i1, descr=arraydescr)
+        jump(i1, p1)
+        """
         # We cannot track virtuals that survive for more than two iterations.
-        self.optimize_loop(ops, 'Not, Not, Not', ops)
+        self.optimize_loop(ops, 'Not, Not, Not', expected, preamble)
 
     def test_varray_forced_1(self):
         ops = """
@@ -1265,12 +1279,18 @@
         setfield_gc(p3, i1, descr=adescr)
         jump(i1, p3)
         """
-        expected = """
-        [i1, i2]
+        preamble = """
+        [i1, p2]
+        i2 = getfield_gc(p2, descr=adescr)
         escape(i2)
-        jump(i1, i1)
+        jump(i1)
+        """
+        expected = """
+        [i1]
+        escape(i1)
+        jump(i1)
         """
-        self.optimize_loop(ops, 'Not, VStruct(ssize, adescr=Not)', expected)
+        self.optimize_loop(ops, 'Not, Not', expected, preamble)
 
     def test_p123_vstruct(self):
         ops = """
@@ -1281,8 +1301,22 @@
         setfield_gc(p1, i1, descr=adescr)
         jump(i1, p1, p2)
         """
+        preamble = """
+        [i1, p2, p3]
+        i3 = getfield_gc(p3, descr=adescr)
+        escape(i3)
+        jump(i1, p2)
+        """
+        expected = """
+        [i1, p2]
+        i3 = getfield_gc(p2, descr=adescr)
+        escape(i3)
+        p1 = new(descr=ssize)
+        setfield_gc(p1, i1, descr=adescr)
+        jump(i1, p1)
+        """
         # We cannot track virtuals that survive for more than two iterations.
-        self.optimize_loop(ops, 'Not, Not, Not', ops)
+        self.optimize_loop(ops, 'Not, Not, Not', expected, preamble)
 
     def test_duplicate_getfield_1(self):
         ops = """



More information about the Pypy-commit mailing list