Home - Summaries: (main) : (py3.11) : (py3.12) : Everything - Nightly builds - Benchmarks - RPython - Builders - About

pypy/module/pypyjit/test_pypy_c/test_instance.py::TestInstance::()::test_super_no_args

self = <pypy.module.pypyjit.test_pypy_c.test_instance.TestInstance object at 0x12768e10>

    def test_super_no_args(self):
        def main():
            class A(object):
                def m(self, x):
                    return x + 1
            class B(A):
                def m(self, x):
                    return super().m(x)
            i = 0
            while i < 300:
                i = B().m(i)
            return i
    
        log = self.run(main, [])
        loop, = log.loops_by_filename(self.filepath)
>       assert loop.match("""
                i78 = int_lt(i72, 300)
                guard_true(i78, descr=...)
                guard_not_invalidated(descr=...)
                p1 = force_token()
                p65 = force_token()
                p3 = force_token()
                i81 = int_add(i72, 1)
    
                # can't use TICK here, because of the extra setfield_gc
                ticker0 = getfield_raw_i(#, descr=<FieldS pypysig_long_struct_inner.c_value .*>)
                setfield_gc(p0, p65, descr=<FieldP pypy.interpreter.pyframe.PyFrame.vable_token .>)
                ticker_cond0 = int_lt(ticker0, 0)
                guard_false(ticker_cond0, descr=...)
    
                jump(..., descr=...)
            """)

pypy/module/pypyjit/test_pypy_c/test_instance.py:273: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
pypy/module/pypyjit/test_pypy_c/model.py:177: in match
    return matcher.match(expected_src, **kwds)
pypy/module/pypyjit/test_pypy_c/model.py:524: in match
    self.match_loop(expected_ops, ignore_ops)
pypy/module/pypyjit/test_pypy_c/model.py:500: in match_loop
    self.match_op(op, exp_op)
pypy/module/pypyjit/test_pypy_c/model.py:409: in match_op
    self._assert(op.name == exp_opname, "operation mismatch")
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <pypy.module.pypyjit.test_pypy_c.model.OpMatcher object at 0x1281d750>
cond = False, message = 'operation mismatch'

    def _assert(self, cond, message):
        if not cond:
>           raise InvalidMatch(message, frame=sys._getframe(1))
E           InvalidMatch: operation mismatch

pypy/module/pypyjit/test_pypy_c/model.py:402: InvalidMatch
---------- Captured stdout call ----------
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Loops don't match
=================
loop id = None
('operation mismatch',)
<could not determine information>

Ignore ops: []
Got:

	===== HERE =====
    guard_not_invalidated(descr=<Guard0xf48c5c68>)
    i56 = int_lt(i48, 300)
    guard_true(i56, descr=<Guard0xf4877400>)
    p57 = force_token()
    p60 = force_token()
    p61 = force_token()
    i65 = int_add(i48, 1)
    i69 = getfield_raw_i(-134939520, descr=<FieldS pypysig_long_struct_inner.c_value 0>)
    setfield_gc(p0, p60, descr=<FieldP pypy.interpreter.pyframe.PyFrame.vable_token 8>)
    i71 = int_lt(i69, 0)
    guard_false(i71, descr=<Guard0xf48c5c90>)
    jump(p0, p1, p8, i65, p20, p30, descr=TargetToken(-191693640))

Expected:
    
    i78 = int_lt(i72, 300)
    guard_true(i78, descr=...)
    guard_not_invalidated(descr=...)
    p1 = force_token()
    p65 = force_token()
    p3 = force_token()
    i81 = int_add(i72, 1)
    
    # can't use TICK here, because of the extra setfield_gc
    ticker0 = getfield_raw_i(#, descr=<FieldS pypysig_long_struct_inner.c_value .*>)
    setfield_gc(p0, p65, descr=<FieldP pypy.interpreter.pyframe.PyFrame.vable_token .>)
    ticker_cond0 = int_lt(ticker0, 0)
    guard_false(ticker_cond0, descr=...)
    
    jump(..., descr=...)
builder: pypy-c-jit-linux-x86-32 build #8482+
test: pypy/module/pypyjit/test_pypy_c/test_instance.py::TestInstance::()::test_super_no_args