[pypy-svn] pypy jit-short-preamble: hg merge default

hakanardo commits-noreply at bitbucket.org
Mon Jan 17 07:33:46 CET 2011


Author: Hakan Ardo <hakan at debian.org>
Branch: jit-short-preamble
Changeset: r40742:d6aa0841d31a
Date: 2011-01-17 07:33 +0100
http://bitbucket.org/pypy/pypy/changeset/d6aa0841d31a/

Log:	hg merge default

diff --git a/pypy/module/pypyjit/test/test_pypy_c.py b/pypy/module/pypyjit/test/test_pypy_c.py
--- a/pypy/module/pypyjit/test/test_pypy_c.py
+++ b/pypy/module/pypyjit/test/test_pypy_c.py
@@ -1489,6 +1489,21 @@
                  ([-10, -20], 200 * (-10 % -20)),
                         count_debug_merge_point=False)
         assert self.jit_summary.tracing_no == 2
+    def test_id_compare_optimization(self):
+        # XXX: lower the instruction count, 35 is the old value.
+        self.run_source("""
+        class A(object):
+            pass
+        def main():
+            i = 0
+            a = A()
+            while i < 5:
+                if A() != a:
+                    pass
+                i += 1
+        """, 35, ([], None))
+        _, compare = self.get_by_bytecode("COMPARE_OP")
+        assert "call" not in compare.get_opnames()
 
 class AppTestJIT(PyPyCJITTests):
     def setup_class(cls):


More information about the Pypy-commit mailing list