[pypy-commit] pypy improve-consecutive-dict-lookups: A failing test (for stupid reasons)

fijal noreply at buildbot.pypy.org
Mon Mar 17 12:31:56 CET 2014


Author: Maciej Fijalkowski <fijall at gmail.com>
Branch: improve-consecutive-dict-lookups
Changeset: r70009:657f9e5f56a7
Date: 2014-03-17 13:31 +0200
http://bitbucket.org/pypy/pypy/changeset/657f9e5f56a7/

Log:	A failing test (for stupid reasons)

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
@@ -208,6 +208,27 @@
             return s
 
         self.meta_interp(f, [10])
+        # XXX should be one getinteriorfield_gc
+        self.check_simple_loop(call=1, getinteriorfield_gc=2,
+                               guard_no_exception=1)
+
+    def test_dict_insert_invalidates_caches(self):
+        driver = JitDriver(greens = [], reds = 'auto')
+        d = {'a': 3, 'b': 4}
+        indexes = ['a', 'b']
+
+        def f(n):
+            s = 0
+            while n > 0:
+                driver.jit_merge_point()
+                index = indexes[n & 1]
+                s += d[index]
+                d['aa'] = 13 # this will invalidate the index
+                s += d[index]
+                n -= 1
+            return s
+
+        self.meta_interp(f, [10])
         self.check_simple_loop(call=1, getinteriorfield_gc=1,
                                guard_no_exception=1)
 


More information about the pypy-commit mailing list