[pypy-commit] pypy jit-short_from_state: more cases

hakanardo noreply at buildbot.pypy.org
Wed Aug 10 13:16:50 CEST 2011


Author: Hakan Ardo <hakan at debian.org>
Branch: jit-short_from_state
Changeset: r46412:9536651c7da2
Date: 2011-08-10 09:11 +0200
http://bitbucket.org/pypy/pypy/changeset/9536651c7da2/

Log:	more cases

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
@@ -7024,7 +7024,7 @@
         """
         self.optimize_loop(ops, expected)
 
-    def test_samebox_getfield_setfield(self):
+    def test_constptr_samebox_getfield_setfield(self):
         ops = """
         [p0]
         p10 = getfield_gc(ConstPtr(myptr), descr=valuedescr)
@@ -7039,7 +7039,7 @@
         """
         self.optimize_loop(ops, expected)
 
-    def test_constptr_getfield_setfield(self):
+    def test_constptr_constptr_getfield_setfield(self):
         ops = """
         [p0]
         p10 = getfield_gc(ConstPtr(myptr), descr=valuedescr)
@@ -7049,12 +7049,45 @@
         jump(p0)
         """
         expected = """
+        [p0]
+        call(ConstPtr(myptr2), descr=nonwritedescr)
+        jump(p0)
+        """
+        self.optimize_loop(ops, expected)
+
+    def test_box_samebox_getfield_setfield(self):
+        ops = """
+        [p0]
+        p10 = getfield_gc(p0, descr=valuedescr)
+        call(p10, descr=nonwritedescr)
+        setfield_gc(p0, p10, descr=valuedescr)
+        jump(p0)
+        """
+        expected = """
         [p0, p10]
         call(p10, descr=nonwritedescr)
         jump(p0, p10)
         """
         self.optimize_loop(ops, expected)
 
+    def test_box_constptr_getfield_setfield(self):
+        ops = """
+        [p0]
+        p10 = getfield_gc(p0, descr=valuedescr)
+        guard_value(p10, ConstPtr(myptr2)) []
+        call(p10, descr=nonwritedescr)
+        setfield_gc(p0, ConstPtr(myptr2), descr=valuedescr)
+        jump(p0)
+        """
+        expected = """
+        [p0]
+        call(ConstPtr(myptr2), descr=nonwritedescr)
+        jump(p0)
+        """
+        self.optimize_loop(ops, expected)
+
+        
+
 class TestLLtype(OptimizeOptTest, LLtypeMixin):
     pass
         


More information about the pypy-commit mailing list