Author: Armin Rigo <[email protected]>
Branch: 
Changeset: r64683:25b2bcefa539
Date: 2013-05-31 17:37 +0200
http://bitbucket.org/pypy/pypy/changeset/25b2bcefa539/

Log:    Fix test_pypy_c, at least on tannit64.

diff --git a/pypy/module/pypyjit/test_pypy_c/test_containers.py 
b/pypy/module/pypyjit/test_pypy_c/test_containers.py
--- a/pypy/module/pypyjit/test_pypy_c/test_containers.py
+++ b/pypy/module/pypyjit/test_pypy_c/test_containers.py
@@ -13,6 +13,7 @@
             a = A()
             a.x = 1
             for s in sys.modules.keys() * 1000:
+                d.get(s)  # force pending setfields etc.
                 inc = a.x # ID: look
                 d[s] = d.get(s, 0) + inc
             return sum(d.values())
@@ -21,8 +22,7 @@
         assert log.result % 1000 == 0
         loop, = log.loops_by_filename(self.filepath)
         ops = loop.ops_by_id('look')
-        assert log.opnames(ops) == ['setfield_gc',
-                                    'guard_not_invalidated']
+        assert log.opnames(ops) == []
 
     def test_identitydict(self):
         def fn(n):
diff --git a/pypy/module/pypyjit/test_pypy_c/test_min_max.py 
b/pypy/module/pypyjit/test_pypy_c/test_min_max.py
--- a/pypy/module/pypyjit/test_pypy_c/test_min_max.py
+++ b/pypy/module/pypyjit/test_pypy_c/test_min_max.py
@@ -49,17 +49,20 @@
         label(..., descr=...)
         ...
         label(..., descr=...)
+        guard_not_invalidated?
         i17 = int_ge(i11, i7)
         guard_false(i17, descr=...)
         p18 = getarrayitem_gc(p5, i11, descr=...)
         i19 = int_add(i11, 1)
         setfield_gc(p2, i19, descr=...)
-        guard_class(p18, ConstClass(W_IntObject), descr=...)
+        guard_nonnull_class(p18, ConstClass(W_IntObject), descr=...)
         i20 = getfield_gc_pure(p18, descr=...)
         i21 = int_gt(i20, i14)
         guard_true(i21, descr=...)
         jump(..., descr=...)
         ''')
+        # XXX could be "guard_class(p18)" instead; we lost somewhere
+        # the information that it cannot be null.
 
     def test_iter_max(self):
         def main():
diff --git a/pypy/module/pypyjit/test_pypy_c/test_misc.py 
b/pypy/module/pypyjit/test_pypy_c/test_misc.py
--- a/pypy/module/pypyjit/test_pypy_c/test_misc.py
+++ b/pypy/module/pypyjit/test_pypy_c/test_misc.py
@@ -177,6 +177,7 @@
         assert log.result == 1000 * 999 / 2
         loop, = log.loops_by_filename(self.filepath)
         assert loop.match("""
+            guard_not_invalidated?
             i16 = int_ge(i11, i12)
             guard_false(i16, descr=...)
             i17 = int_mul(i11, i14)
@@ -184,7 +185,7 @@
             i20 = int_add(i11, 1)
             i21 = force_token()
             setfield_gc(p4, i20, descr=<.* 
.*W_AbstractSeqIterObject.inst_index .*>)
-            guard_not_invalidated(descr=...)
+            guard_not_invalidated?
             i23 = int_lt(i18, 0)
             guard_false(i23, descr=...)
             i25 = int_ge(i18, i9)
@@ -234,6 +235,7 @@
         assert log.result == 1000000
         loop, = log.loops_by_filename(self.filepath)
         assert loop.match("""
+            guard_not_invalidated?
             i14 = getfield_gc(p12, descr=<FieldS list.length .*>)
             i16 = uint_ge(i12, i14)
             guard_false(i16, descr=...)
@@ -242,7 +244,7 @@
             i19 = int_add(i12, 1)
             setfield_gc(p9, i19, descr=<FieldS 
.*W_AbstractSeqIterObject.inst_index .*>)
             guard_nonnull_class(p17, ..., descr=...)
-            guard_not_invalidated(descr=...)
+            guard_not_invalidated?
             i21 = getfield_gc(p17, descr=<FieldS .*W_Array.*.inst_len .*>)
             i23 = int_lt(0, i21)
             guard_true(i23, descr=...)
diff --git a/pypy/module/pypyjit/test_pypy_c/test_string.py 
b/pypy/module/pypyjit/test_pypy_c/test_string.py
--- a/pypy/module/pypyjit/test_pypy_c/test_string.py
+++ b/pypy/module/pypyjit/test_pypy_c/test_string.py
@@ -157,7 +157,7 @@
             copystrcontent(p9, p21, 0, i25, i10)
             i33 = int_lt(i30, 23)
             guard_true(i33, descr=...)
-            p35 = call(ConstClass(ll_shrink_array__rpy_stringPtr_Signed), p21, 
i30, descr=<Callr . ri EF=4>)
+            p35 = call(ConstClass(ll_shrink_array__rpy_stringPtr_Signed), p21, 
i30, descr=<Callr . ri EF=4 OS=3>)
             guard_no_exception(descr=...)
             i37 = strlen(p35)
             i38 = int_add_ovf(i5, i37)
@@ -190,7 +190,7 @@
         assert len(loops) == 1
         for loop in loops:
             loop.match_by_id('getattr','''
-            guard_not_invalidated(descr=...)
+            guard_not_invalidated?
             i32 = strlen(p31)
             i34 = int_add(5, i32)
             p35 = newstr(i34)
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to