Commits

Armin Rigo committed 6ab51a5

Finish adapting to out-of-line-guards-2.

  • Participants
  • Parent commits 0425648
  • Branches out-of-line-guards-2

Comments (0)

Files changed (1)

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

             i20 = int_add(i11, 1)
             i21 = force_token()
             setfield_gc(p4, i20, descr=<.* .*W_AbstractSeqIterObject.inst_index .*>)
+            guard_not_invalidated(descr=<Guard4>)
             i23 = int_lt(i18, 0)
-            guard_false(i23, descr=<Guard4>)
+            guard_false(i23, descr=<Guard5>)
             i25 = int_ge(i18, i9)
-            guard_false(i25, descr=<Guard5>)
-            i26 = int_mul(i18, i10)
-            i27 = int_add_ovf(i7, i26)
-            guard_no_overflow(descr=<Guard6>)
+            guard_false(i25, descr=<Guard6>)
+            i27 = int_add_ovf(i7, i18)
+            guard_no_overflow(descr=<Guard7>)
             --TICK--
-            jump(p0, p1, p2, p3, p4, p5, p6, i27, i18, i9, i10, i20, i12, p13, i14, i15, descr=<Loop0>)
+            jump(..., descr=<Loop0>)
         """)
 
     def test_exception_inside_loop_1(self):
         assert loop.match("""
         i5 = int_is_true(i3)
         guard_true(i5, descr=<Guard3>)
+        guard_not_invalidated(descr=<Guard4>)
         --EXC-TICK--
         i12 = int_sub_ovf(i3, 1)
-        guard_no_overflow(descr=<Guard5>)
+        guard_no_overflow(descr=<Guard6>)
         --TICK--
-        jump(p0, p1, p2, i12, descr=<Loop0>)
+        jump(..., descr=<Loop0>)
         """)
 
     def test_exception_inside_loop_2(self):
         assert loop.match("""
             i7 = int_lt(i4, i5)
             guard_true(i7, descr=<Guard3>)
+            guard_not_invalidated(descr=<Guard4>)
             --EXC-TICK--
             i14 = int_add(i4, 1)
             --TICK--
-            jump(p0, p1, p2, p3, i14, i5, descr=<Loop0>)
+            jump(..., descr=<Loop0>)
         """)
 
     def test_chain_of_guards(self):
         assert loop.match_by_id('import', """
             p11 = getfield_gc(ConstPtr(ptr10), descr=<GcPtrFieldDescr pypy.objspace.std.celldict.ModuleCell.inst_w_value 8>)
             guard_value(p11, ConstPtr(ptr12), descr=<Guard4>)
+            guard_not_invalidated(descr=<Guard5>)
             p14 = getfield_gc(ConstPtr(ptr13), descr=<GcPtrFieldDescr pypy.objspace.std.celldict.ModuleCell.inst_w_value 8>)
             p16 = getfield_gc(ConstPtr(ptr15), descr=<GcPtrFieldDescr pypy.objspace.std.celldict.ModuleCell.inst_w_value 8>)
-            guard_value(p14, ConstPtr(ptr17), descr=<Guard5>)
-            guard_isnull(p16, descr=<Guard6>)
+            guard_value(p14, ConstPtr(ptr17), descr=<Guard6>)
+            guard_isnull(p16, descr=<Guard7>)
         """)
 
     def test_import_fast_path(self, tmpdir):
         # -------------------------------
         entry_bridge, = log.loops_by_filename(self.filepath, is_entry_bridge=True)
         ops = entry_bridge.ops_by_id('mutate', opcode='LOAD_ATTR')
-        assert log.opnames(ops) == ['guard_value', 'getfield_gc', 'guard_value',
+        assert log.opnames(ops) == ['guard_value', 'guard_not_invalidated',
                                     'getfield_gc', 'guard_nonnull_class']
         # the STORE_ATTR is folded away
         assert list(entry_bridge.ops_by_id('meth1', opcode='STORE_ATTR')) == []
             i8 = getfield_gc_pure(p5, descr=<SignedFieldDescr .*W_IntObject.inst_intval.*>)
             i9 = int_lt(i8, i7)
             guard_true(i9, descr=.*)
+            guard_not_invalidated(descr=.*)
             i11 = int_add(i8, 1)
             i12 = force_token()
             --TICK--