Author: Armin Rigo <ar...@tunes.org>
Branch: 
Changeset: r70155:b03753b1bf5e
Date: 2014-03-22 08:29 +0100
http://bitbucket.org/pypy/pypy/changeset/b03753b1bf5e/

Log:    Fix test.

        A nice side-effect of the improve-consecutive-dict-lookups branch:
        multiple loads or stores of attributes in an oldstyle class instance
        are folded.

diff --git a/pypy/module/pypyjit/test_pypy_c/test_instance.py 
b/pypy/module/pypyjit/test_pypy_c/test_instance.py
--- a/pypy/module/pypyjit/test_pypy_c/test_instance.py
+++ b/pypy/module/pypyjit/test_pypy_c/test_instance.py
@@ -141,15 +141,16 @@
             i = 0
             b = B(1)
             while i < 100:
-                b.x
-                v = b.x # ID: loadattr
+                v = b.x # ID: loadattr1
+                v = b.x # ID: loadattr2
                 i += v
             return i
 
         log = self.run(main, [], threshold=80)
         loop, = log.loops_by_filename(self.filepath)
-        assert loop.match_by_id('loadattr',
+        assert loop.match_by_id('loadattr1',
         '''
+        guard_not_invalidated(descr=...)
         i19 = call(ConstClass(ll_dict_lookup), _, _, _, descr=...)
         guard_no_exception(descr=...)
         i21 = int_and(i19, _)
@@ -161,6 +162,7 @@
         i29 = int_is_true(i28)
         guard_true(i29, descr=...)
         ''')
+        assert loop.match_by_id('loadattr2', "")   # completely folded away
 
     def test_python_contains(self):
         def main():
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to