[pypy-commit] pypy default: avoid tracking an index in setslice, update/enable its test_zjit

bdkearns noreply at buildbot.pypy.org
Wed Dec 3 23:11:31 CET 2014


Author: Brian Kearns <bdkearns at gmail.com>
Branch: 
Changeset: r74798:f1b314da580e
Date: 2014-12-03 17:01 -0500
http://bitbucket.org/pypy/pypy/changeset/f1b314da580e/

Log:	avoid tracking an index in setslice, update/enable its test_zjit

diff --git a/pypy/module/micronumpy/loop.py b/pypy/module/micronumpy/loop.py
--- a/pypy/module/micronumpy/loop.py
+++ b/pypy/module/micronumpy/loop.py
@@ -104,6 +104,7 @@
     # array implementations, not arrays
     target_iter, target_state = target.create_iter(shape)
     source_iter, source_state = source.create_iter(shape)
+    source_iter.track_index = False
     dtype = target.dtype
     shapelen = len(shape)
     while not target_iter.done(target_state):
diff --git a/pypy/module/micronumpy/test/test_zjit.py b/pypy/module/micronumpy/test/test_zjit.py
--- a/pypy/module/micronumpy/test/test_zjit.py
+++ b/pypy/module/micronumpy/test/test_zjit.py
@@ -479,20 +479,27 @@
         a = |30|
         b = |10|
         b[1] = 5.5
-        c = b + b
-        a[0:30:3] = c
+        a[0:30:3] = b
         a -> 3
         """
 
     def test_setslice(self):
         result = self.run("setslice")
-        assert result == 11.0
-        py.test.skip("don't run for now")
+        assert result == 5.5
         self.check_trace_count(1)
-        self.check_simple_loop({'raw_load': 2, 'float_add': 1,
-                                'raw_store': 1, 'int_add': 2,
-                                'int_eq': 1, 'guard_false': 1, 'jump': 1,
-                                'arraylen_gc': 1})
+        self.check_simple_loop({
+            'getarrayitem_gc': 1,
+            'guard_false': 1,
+            'guard_not_invalidated': 1,
+            'guard_true': 1,
+            'int_add': 4,
+            'int_ge': 1,
+            'int_lt': 1,
+            'jump': 1,
+            'raw_load': 1,
+            'raw_store': 1,
+            'setarrayitem_gc': 1,
+        })
 
     def define_virtual_slice():
         return """


More information about the pypy-commit mailing list