[pypy-commit] pypy small-unroll-improvements: a test showing the remaining problems of dicts and bridges

cfbolz noreply at buildbot.pypy.org
Mon Apr 21 15:17:39 CEST 2014


Author: Carl Friedrich Bolz <cfbolz at gmx.de>
Branch: small-unroll-improvements
Changeset: r70808:e06ce12276e8
Date: 2014-04-21 15:16 +0200
http://bitbucket.org/pypy/pypy/changeset/e06ce12276e8/

Log:	a test showing the remaining problems of dicts and bridges

diff --git a/rpython/jit/metainterp/test/test_dict.py b/rpython/jit/metainterp/test/test_dict.py
--- a/rpython/jit/metainterp/test/test_dict.py
+++ b/rpython/jit/metainterp/test/test_dict.py
@@ -342,6 +342,21 @@
         self.meta_interp(f, [10])
         self.check_simple_loop(call_may_force=0, call=3)
 
+    def test_dict_virtual(self):
+        myjitdriver = JitDriver(greens = [], reds = 'auto')
+        def f(n):
+            d = {}
+            while n > 0:
+                myjitdriver.jit_merge_point()
+                if n % 10 == 0:
+                    n -= len(d)
+                d = {}
+                d["a"] = n
+                n -= 1
+            return len(d)
+        self.meta_interp(f, [100])
+        self.check_simple_loop(call_may_force=0, call=3)
+
 
 class TestLLtype(DictTests, LLJitMixin):
     pass


More information about the pypy-commit mailing list