Author: Armin Rigo <[email protected]>
Branch: 
Changeset: r73914:bbebe6918aa9
Date: 2014-10-13 11:10 +0200
http://bitbucket.org/pypy/pypy/changeset/bbebe6918aa9/

Log:    Remove the test added in 26690b5aa284. Add an explanation into a
        related test.

diff --git a/rpython/jit/metainterp/optimizeopt/test/test_optimizeopt.py 
b/rpython/jit/metainterp/optimizeopt/test/test_optimizeopt.py
--- a/rpython/jit/metainterp/optimizeopt/test/test_optimizeopt.py
+++ b/rpython/jit/metainterp/optimizeopt/test/test_optimizeopt.py
@@ -8293,6 +8293,22 @@
         self.optimize_loop(ops, expected)
 
     def test_licm_boxed_opaque_getitem_unknown_class(self):
+        # Explanation: the getfield_gc(p2) is done on what starts as
+        # an opaque object.  The getfield_gc(p1) is moved out of the
+        # (non-preamble) loop.  It looks like the getfield_gc(p2)
+        # should also move out.  However, moving the getfield_gc(p2)
+        # earlier can be dangerous with opaque pointers: we can't move
+        # it before other guards that indirectly check for which type
+        # of object is in p2.  (In this simple test there are no guard
+        # at all between the start of the loop and the
+        # getfield_gc(p2), but in general there are.)
+        #
+        # There are two cases: (1) moving the getfield_gc(p2) out of
+        # the loop into the preamble: this does not look like a
+        # problem because we already have a getfield_gc(p2) there, on
+        # the same p2.  Case (2) is moving the getfield_gc(p2) into
+        # the short preamble: this is more problematic because the
+        # short preamble can't do the indirect checking on p1.
         ops = """
         [p1]
         p2 = getfield_gc(p1, descr=nextdescr)
@@ -8326,6 +8342,7 @@
         self.optimize_loop(ops, expected)
 
     def test_licm_unboxed_opaque_getitem_unknown_class(self):
+        # see test_licm_boxed_opaque_getitem_unknown_class
         ops = """
         [p2]
         mark_opaque_ptr(p2)
@@ -8411,22 +8428,5 @@
         """
         self.optimize_loop(ops, expected, preamble)
 
-    def test_mark_opaque_ptr_doesnt_prevent_other_opts(self):
-        py.test.skip("XXX what is mark_opaque_ptr really for?")
-        # this test passes if we don't put mark_opaque_ptr(p1)
-        ops = """
-        [p1, i1]
-        mark_opaque_ptr(p1)
-        i2 = getfield_gc(p1, descr=otherdescr)
-        i3 = int_add(i1, i2)
-        jump(p1, i3)
-        """
-        expected = """
-        [p1, i1, i2]
-        i3 = int_add(i1, i2)
-        jump(p1, i3, i2)
-        """
-        self.optimize_loop(ops, expected)
-
 class TestLLtype(OptimizeOptTest, LLtypeMixin):
     pass
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to