Commits

Armin Rigo committed 2667bb5

Fix this test. Explain why it's longer.

  • Participants
  • Parent commits 3e09422
  • Branches stringbuilder2-perf

Comments (0)

Files changed (1)

File pypy/module/pypyjit/test_pypy_c/test_string.py

         log = self.run(main, [1000])
         assert log.result == main(1000)
         loop, = log.loops_by_filename(self.filepath)
+        # NB: since the stringbuilder2-perf branch we get more operations than
+        # before, but a lot less branches that might fail randomly.
         assert loop.match("""
-            i7 = int_gt(i4, 0)
-            guard_true(i7, descr=...)
+            i100 = int_gt(i95, 0)
+            guard_true(i100, descr=...)
             guard_not_invalidated(descr=...)
-            p9 = call(ConstClass(ll_int2dec__Signed), i4, descr=<Callr . i EF=3>)
+            p101 = call(ConstClass(ll_int2dec__Signed), i95, descr=<Callr . i EF=3>)
             guard_no_exception(descr=...)
-            i10 = strlen(p9)
-            i11 = int_is_true(i10)
-            guard_true(i11, descr=...)
-            i13 = strgetitem(p9, 0)
-            i15 = int_eq(i13, 45)
-            guard_false(i15, descr=...)
-            i17 = int_neg(i10)
-            i19 = int_gt(i10, 23)
-            guard_false(i19, descr=...)
-            p21 = newstr(23)
-            copystrcontent(p9, p21, 0, 0, i10)
-            i25 = int_add(1, i10)
-            i26 = int_gt(i25, 23)
-            guard_false(i26, descr=...)
-            strsetitem(p21, i10, 32)
-            i30 = int_add(i10, i25)
-            i31 = int_gt(i30, 23)
-            guard_false(i31, descr=...)
-            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 OS=3>)
+            i102 = strlen(p101)
+            i103 = int_is_true(i102)
+            guard_true(i103, descr=...)
+            i104 = strgetitem(p101, 0)
+            i105 = int_eq(i104, 45)
+            guard_false(i105, descr=...)
+            i106 = int_neg(i102)
+            i107 = int_gt(i102, 23)
+            p108 = new(descr=<SizeDescr .+>)
+            p110 = newstr(23)
+            setfield_gc(..., descr=<Field. stringbuilder.+>)
+            setfield_gc(..., descr=<Field. stringbuilder.+>)
+            setfield_gc(..., descr=<Field. stringbuilder.+>)
+            cond_call(i107, ConstClass(stringbuilder_append_overflow__stringbuilderPtr_rpy_stringPtr_Signed), p108, p101, i102, descr=<Callv 0 rri EF=4>)
             guard_no_exception(descr=...)
-            i37 = strlen(p35)
-            i38 = int_add_ovf(i5, i37)
+            i111 = getfield_gc(p108, descr=<FieldS stringbuilder.skip .+>)
+            i112 = int_sub(i102, i111)
+            i113 = getfield_gc(p108, descr=<FieldS stringbuilder.current_pos .+>)
+            p114 = getfield_gc(p108, descr=<FieldP stringbuilder.current_buf .+>)
+            copystrcontent(p101, p114, i111, i113, i112)
+            i115 = int_add(i113, i112)
+            i116 = getfield_gc(p108, descr=<FieldS stringbuilder.current_end .+>)
+            setfield_gc(p108, i115, descr=<FieldS stringbuilder.current_pos .+>)
+            i117 = int_eq(i115, i116)
+            cond_call(i117, ConstClass(stringbuilder_grow__stringbuilderPtr_Signed), p108, 1, descr=<Callv 0 ri EF=4>)
+            guard_no_exception(descr=...)
+            i118 = getfield_gc(p108, descr=<FieldS stringbuilder.current_pos .+>)
+            i119 = int_add(i118, 1)
+            p120 = getfield_gc(p108, descr=<FieldP stringbuilder.current_buf .+>)
+            strsetitem(p120, i118, 32)
+            i121 = getfield_gc(p108, descr=<FieldS stringbuilder.current_end .+>)
+            i122 = int_sub(i121, i119)
+            setfield_gc(..., descr=<FieldS stringbuilder.+>)
+            setfield_gc(..., descr=<FieldS stringbuilder.+>)
+            i123 = int_gt(i102, i122)
+            cond_call(i123, ConstClass(stringbuilder_append_overflow__stringbuilderPtr_rpy_stringPtr_Signed), p108, p101, i102, descr=<Callv 0 rri EF=4>)
+            guard_no_exception(descr=...)
+            i124 = getfield_gc(p108, descr=<FieldS stringbuilder.skip .+>)
+            i125 = int_sub(i102, i124)
+            i126 = getfield_gc(p108, descr=<FieldS stringbuilder.current_pos .+>)
+            p127 = getfield_gc(p108, descr=<FieldP stringbuilder.current_buf .+>)
+            copystrcontent(p101, p127, i124, i126, i125)
+            i128 = int_add(i126, i125)
+            setfield_gc(p108, i128, descr=<FieldS stringbuilder.current_pos .+>)
+            p135 = call(..., descr=<Callr . r EF=4)     # ll_build
+            guard_no_exception(descr=...)
+            i136 = strlen(p135)
+            i137 = int_add_ovf(i92, i136)
             guard_no_overflow(descr=...)
-            i40 = int_sub(i4, 1)
+            i138 = int_sub(i95, 1)
             --TICK--
             jump(..., descr=...)
         """)