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

pypy/module/pypyjit/test_pypy_c/test_call.py::TestCall::()::test_method_call

self = <pypy.module.pypyjit.test_pypy_c.test_call.TestCall object at 0x0000000029ef26e8>

    def test_method_call(self):
        def fn(n):
            class A(object):
                def __init__(self, a):
                    self.a = a
                def f(self, i):
                    return self.a + i
            a = A("a") # stop field unboxing
    
            i = 0
            a = A(1)
            while i < n:
                x = a.f(i)    # ID: meth1
                i = a.f(x)    # ID: meth2
            return i
        #
        log = self.run(fn, [1000])
        assert log.result == 1000
        #
        # first, we test the entry bridge
        # -------------------------------
        entry_bridge, = log.loops_by_filename(self.filepath, is_entry_bridge=True)
        ops = entry_bridge.ops_by_id('meth1', opcode='LOAD_METHOD')
        assert log.opnames(ops) == ['guard_value', 'getfield_gc_r',
                                    'guard_value',
>                                   'guard_not_invalidated']
E       assert ['getfield_gc...'guard_value'] == ['guard_value'..._invalidated']
E         At index 0 diff: 'getfield_gc_r' != 'guard_value'
E         Right contains more items, first extra item: 'guard_value'
E         Use -v to get the full diff

pypy/module/pypyjit/test_pypy_c/test_call.py:136: AssertionError
builder: pypy-c-jit-linux-aarch64 build #3041+
test: pypy/module/pypyjit/test_pypy_c/test_call.py::TestCall::()::test_method_call