python testrunner/pypyjit_tests.py
in dir /buildbot/slave/pypy-c-jit-linux-aarch64/build (timeout 4000 secs)
watching logfiles {'pytestLog': 'pypyjit_new.log'}
argv: ['python', 'testrunner/pypyjit_tests.py']
environment:
AUDITWHEEL_ARCH=aarch64
AUDITWHEEL_PLAT=manylinux_2_28_aarch64
AUDITWHEEL_POLICY=manylinux_2_28
DEVTOOLSET_ROOTPATH=/opt/rh/gcc-toolset-14/root
HGDEMANDIMPORT=disable
HOME=/home/buildworker
HOSTNAME=ebdee9f243b1
LANG=en_US.UTF-8
LANGUAGE=en_US.UTF-8
LC_ALL=en_US.UTF-8
LD_LIBRARY_PATH=/usr/local/lib:/opt/rh/gcc-toolset-14/root/usr/lib64:/opt/rh/gcc-toolset-14/root/usr/lib:/opt/rh/gcc-toolset-14/root/usr/lib64/dyninst:/opt/rh/gcc-toolset-14/root/usr/lib/dyninst
OLDPWD=/buildbot/slave
PATH=/tmp/venv/bin:/opt/clang/bin:/opt/rh/gcc-toolset-14/root/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/pypy2.7-v7.3.22-aarch64/bin
PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
PS1=(venv)
PWD=/buildbot/slave/pypy-c-jit-linux-aarch64/build
PYPY_LOCALBASE=/usr/local
PYPY_MAKE_PORTABLE=1
PYPY_USESSION_KEEP=1
SHLVL=0
SSL_CERT_FILE=/opt/_internal/certs.pem
TERM=xterm
TMPDIR=/tmp/pytest
VIRTUAL_ENV=/tmp/venv
container=podman
using PTY: False
/tmp/venv/site-packages/hypothesis/extra/pytestplugin.py:61: HypothesisWarning:
You are using Pytest version 2.9.2. Hypothesis tests work with any test
runner, but our Pytest plugin requires Pytest 4.3 or newer.
Note that the Pytest developers no longer support this version either!
Disabling the Hypothesis pytest plugin...
warnings.warn(PYTEST_TOO_OLD_MESSAGE % (pytest.__version__,), HypothesisWarning)
============================= test session starts ==============================
platform linux2 -- Python 2.7.18[pypy-7.3.22-final], pytest-2.9.2, py-1.4.29, pluggy-0.3.1
pytest-2.9.2 from /buildbot/slave/pypy-c-jit-linux-aarch64/build/pytest.pyc
rootdir: /buildbot/slave/pypy-c-jit-linux-aarch64/build, inifile: pytest.ini
plugins: hypothesis-4.57.1
collected 1195 items / 1 skipped
pypy/module/pypyjit/test_pypy_c/test_00_model.py .................FF.FF..
pypy/module/pypyjit/test_pypy_c/test_alloc.py ...................................................
pypy/module/pypyjit/test_pypy_c/test_array.py F.F.s...
pypy/module/pypyjit/test_pypy_c/test_boolrewrite.py ......................................................................................................................................................................................................................................................................................................................................
pypy/module/pypyjit/test_pypy_c/test_buffers.py FF
pypy/module/pypyjit/test_pypy_c/test_bug.py .
pypy/module/pypyjit/test_pypy_c/test_call.py ..FFF.F.....FFFFF.F.....Fs.
pypy/module/pypyjit/test_pypy_c/test_capture_locals.py .
pypy/module/pypyjit/test_pypy_c/test_cprofile.py .
pypy/module/pypyjit/test_pypy_c/test_exception.py .F.FF
pypy/module/pypyjit/test_pypy_c/test_ffi.py s..s.....F
pypy/module/pypyjit/test_pypy_c/test_generators.py FF.
pypy/module/pypyjit/test_pypy_c/test_getframe.py F.
pypy/module/pypyjit/test_pypy_c/test_globals.py F
pypy/module/pypyjit/test_pypy_c/test_import.py F..F
pypy/module/pypyjit/test_pypy_c/test_instance.py FF.FFF.FFFFF...
pypy/module/pypyjit/test_pypy_c/test_intbound.py .........................................................................................................................................................................................................................................................................FFFFFFF.F.
pypy/module/pypyjit/test_pypy_c/test_itertools.py ..
pypy/module/pypyjit/test_pypy_c/test_jitlogparser.py F
pypy/module/pypyjit/test_pypy_c/test_math.py FFsF.
pypy/module/pypyjit/test_pypy_c/test_micronumpy.py ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss
pypy/module/pypyjit/test_pypy_c/test_min_max.py F..
pypy/module/pypyjit/test_pypy_c/test_misc.py FFFFFF..F.........F.....
pypy/module/pypyjit/test_pypy_c/test_shift.py ...........................................................................................................................................................................................................................
pypy/module/pypyjit/test_pypy_c/test_string.py FFFF..xFF.F........
pypy/module/pypyjit/test_pypy_c/test_struct.py FFFFFF
pypy/module/pypyjit/test_pypy_c/test_thread.py FFF
pypy/module/pypyjit/test_pypy_c/test_weakref.py F
=================================== FAILURES ===================================
________________________ TestRunPyPyC.test_loops_by_id _________________________
self = <pypy.module.pypyjit.test_pypy_c.test_00_model.TestRunPyPyC object at 0x0000000025f22bf0>
def test_loops_by_id(self):
def f():
i = 0
while i < 1003:
i += 1 # ID: increment
return i
#
log = self.run(f)
loop, = log.loops_by_id('increment')
assert loop.filename == self.filepath
assert loop.code.name == 'f'
#
ops = loop.allops()
assert log.opnames(ops) == [
# this is the actual loop
'int_lt', 'guard_true', 'int_add',
# this is the signal checking stuff
'guard_not_invalidated', 'getfield_raw_i', 'int_lt', 'guard_false',
> 'jump'
]
E assert ['guard_not_i...'int_lt', ...] == ['int_lt', 'gu...'int_lt', ...]
E At index 0 diff: 'guard_not_invalidated' != 'int_lt'
E Use -v to get the full diff
pypy/module/pypyjit/test_pypy_c/test_00_model.py:487: AssertionError
_________________________ TestRunPyPyC.test_ops_by_id __________________________
self = <pypy.module.pypyjit.test_pypy_c.test_00_model.TestRunPyPyC object at 0x000000002b37a100>
def test_ops_by_id(self):
def f():
i = 0
while i < 1003: # ID: cond
i += 1 # ID: increment
a = 0 # to make sure that JUMP_ABSOLUTE is not part of the ID
return i
#
log = self.run(f)
loop, = log.loops_by_id('increment')
#
ops = loop.ops_by_id('increment')
assert log.opnames(ops) == ['int_add']
#
ops = loop.ops_by_id('cond')
# the 'jump' at the end is because the last opcode in the loop
# coincides with the first, and so it thinks that 'jump' belongs to
# the id
> assert log.opnames(ops) == ['int_lt', 'guard_true', 'jump']
E assert ['guard_not_i...true', 'jump'] == ['int_lt', 'gu...true', 'jump']
E At index 0 diff: 'guard_not_invalidated' != 'int_lt'
E Left contains more items, first extra item: 'jump'
E Use -v to get the full diff
pypy/module/pypyjit/test_pypy_c/test_00_model.py:508: AssertionError
______________________ TestRunPyPyC.test_inlined_function ______________________
self = <pypy.module.pypyjit.test_pypy_c.test_00_model.TestRunPyPyC object at 0x000000002b59db78>
def test_inlined_function(self):
def f():
def g(x):
return x+1 # ID: add
i = 0
while i < 1003:
i = g(i) # ID: call
a = 0 # to make sure that JUMP_ABSOLUTE is not part of the ID
return i
#
log = self.run(f)
loop, = log.loops_by_filename(self.filepath)
call_ops = log.opnames(loop.ops_by_id('call'))
> assert call_ops == ['guard_not_invalidated', 'force_token'] # it does not follow inlining
E assert ['force_token'] == ['guard_not_invalidated', 'force_token']
E At index 0 diff: 'force_token' != 'guard_not_invalidated'
E Right contains more items, first extra item: 'force_token'
E Use -v to get the full diff
pypy/module/pypyjit/test_pypy_c/test_00_model.py:541: AssertionError
_________________________ TestRunPyPyC.test_loop_match _________________________
self = <pypy.module.pypyjit.test_pypy_c.test_00_model.TestRunPyPyC object at 0x000000002b835e88>
def test_loop_match(self):
def f():
i = 0
while i < 1003:
i += 1 # ID: increment
return i
#
log = self.run(f)
loop, = log.loops_by_id('increment')
> assert loop.match("""
i6 = int_lt(i4, 1003)
guard_true(i6, descr=...)
i8 = int_add(i4, 1)
# signal checking stuff
guard_not_invalidated(descr=...)
i10 = getfield_raw_i(..., descr=<.* pypysig_long_struct_inner.c_value .*>)
i14 = int_lt(i10, 0)
guard_false(i14, descr=...)
jump(..., descr=...)
""")
pypy/module/pypyjit/test_pypy_c/test_00_model.py:565:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
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 0x000000002b9f0f70>
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=<Guard0xffff96d4ab18>)
i26 = int_lt(i20, 1003)
guard_true(i26, descr=<Guard0xffff96d59b20>)
i28 = int_add(i20, 1)
i30 = getfield_raw_i(281473294868168, descr=<FieldS pypysig_long_struct_inner.c_value 0>)
i32 = int_lt(i30, 0)
guard_false(i32, descr=<Guard0xffff96d59b80>)
jump(p0, p1, i28, descr=TargetToken(281473212252768))
Expected:
i6 = int_lt(i4, 1003)
guard_true(i6, descr=...)
i8 = int_add(i4, 1)
# signal checking stuff
guard_not_invalidated(descr=...)
i10 = getfield_raw_i(..., descr=<.* pypysig_long_struct_inner.c_value .*>)
i14 = int_lt(i10, 0)
guard_false(i14, descr=...)
jump(..., descr=...)
_____________________ TestArray.test_arraycopy_disappears ______________________
self = <pypy.module.pypyjit.test_pypy_c.test_array.TestArray object at 0x000000002fd1a288>
def test_arraycopy_disappears(self):
def main(n):
i = 0
while i < n:
t = (1, 2, 3, i + 1)
t2 = t[:]
del t
i = t2[3]
del t2
return i
#
log = self.run(main, [500])
assert log.result == 500
loop, = log.loops_by_filename(self.filepath)
> assert loop.match("""
i7 = int_lt(i5, i6)
guard_true(i7, descr=...)
i9 = int_add(i5, 1)
--TICK--
jump(..., descr=...)
""")
pypy/module/pypyjit/test_pypy_c/test_array.py:20:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
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 0x000000002de09558>
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=<Guard0xffff941a0b60>)
i38 = int_lt(i33, i30)
guard_true(i38, descr=<Guard0xffff941afe50>)
i40 = int_add(i33, 1)
i42 = getfield_raw_i(281473248730824, descr=<FieldS pypysig_long_struct_inner.c_value 0>)
i44 = int_lt(i42, 0)
guard_false(i44, descr=<Guard0xffff941afeb0>)
jump(p0, p1, p8, i40, i30, descr=TargetToken(281473166467680))
Expected:
i7 = int_lt(i5, i6)
guard_true(i7, descr=...)
i9 = int_add(i5, 1)
guard_not_invalidated?
ticker0 = getfield_raw_i(#, descr=<FieldS pypysig_long_struct_inner.c_value .*>)
ticker_cond0 = int_lt(ticker0, 0)
guard_false(ticker_cond0, descr=...)
jump(..., descr=...)
_________________________ TestArray.test_array_intimg __________________________
self = <pypy.module.pypyjit.test_pypy_c.test_array.TestArray object at 0x000000002c588838>
def test_array_intimg(self):
def main():
from array import array
img = array('i', range(3)) * (350 * 480)
intimg = array('i', (0,)) * (640 * 480)
l, i = 0, 640
while i < 640 * 480:
assert len(img) == 3*350*480
assert len(intimg) == 640*480
l = l + img[i]
intimg[i] = (intimg[i-640] + l)
i += 1
return intimg[i - 1]
#
log = self.run(main, [])
assert log.result == 73574560
loop, = log.loops_by_filename(self.filepath)
if sys.maxint == 2 ** 31 - 1:
assert loop.match("""
i13 = int_lt(i8, 307200)
guard_true(i13, descr=...)
guard_not_invalidated(descr=...)
# the bound check guard on img has been killed (thanks to the asserts)
i14 = getarrayitem_raw_i(i10, i8, descr=<ArrayS .>)
i15 = int_add_ovf(i9, i14)
guard_no_overflow(descr=...)
i17 = int_add(i8, -640)
# the bound check guard on intimg has been killed (thanks to the asserts)
i18 = getarrayitem_raw_i(i11, i17, descr=<ArrayS .>)
i19 = int_add_ovf(i18, i15)
guard_no_overflow(descr=...)
setarrayitem_raw(i11, i8, _, descr=<ArrayS .>)
i28 = int_add(i8, 1)
--TICK--
jump(..., descr=...)
""")
elif sys.maxint == 2 ** 63 - 1:
> assert loop.match("""
i13 = int_lt(i8, 307200)
guard_true(i13, descr=...)
guard_not_invalidated(descr=...)
# the bound check guard on img has been killed (thanks to the asserts)
i14 = getarrayitem_raw_i(i10, i8, descr=<ArrayS .>)
# advanced: the following int_add cannot overflow, because:
# - i14 fits inside 32 bits
# - i9 fits inside 33 bits, because:
# - it comes from the previous iteration's i15
# - prev i19 = prev i18 + prev i15
# - prev i18 fits inside 32 bits
# - prev i19 is guarded to fit inside 32 bits
# - so as a consequence, prev i15 fits inside 33 bits
# the new i15 thus fits inside "33.5" bits, which is enough to
# guarantee that the next int_add(i18, i15) cannot overflow either...
i15 = int_add(i9, i14)
i17 = int_add(i8, -640)
# the bound check guard on intimg has been killed (thanks to the asserts)
i18 = getarrayitem_raw_i(i11, i17, descr=<ArrayS .>)
i19 = int_add(i18, i15)
# guard checking that i19 actually fits into 32bit
i20 = int_signext(i19, 4)
i65 = int_ne(i20, i19)
guard_false(i65, descr=...)
setarrayitem_raw(i11, i8, _, descr=<ArrayS .>)
i28 = int_add(i8, 1)
--TICK--
jump(..., descr=...)
""")
pypy/module/pypyjit/test_pypy_c/test_array.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
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 0x000000002b2e9558>
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=<Guard0xffffa577ec38>)
i67 = int_lt(i61, 307200)
guard_true(i67, descr=<Guard0xffffa579ed70>)
i68 = getarrayitem_raw_i(i46, i61, descr=<ArrayS 4>)
i69 = int_add(i49, i68)
i71 = int_add(i61, -640)
i72 = getarrayitem_raw_i(i54, i71, descr=<ArrayS 4>)
i73 = int_add(i72, i69)
i75 = int_signext(i73, 4)
i76 = int_ne(i75, i73)
guard_false(i76, descr=<Guard0xffffa579edd0>)
setarrayitem_raw(i54, i61, i75, descr=<ArrayS 4>)
i78 = int_add(i61, 1)
i80 = getfield_raw_i(281473540234952, descr=<FieldS pypysig_long_struct_inner.c_value 0>)
i82 = int_lt(i80, 0)
guard_false(i82, descr=<Guard0xffffa577ec80>)
jump(p0, p1, p8, p10, p12, i78, i69, p24, i46, i54, descr=TargetToken(281473457832544))
Expected:
i13 = int_lt(i8, 307200)
guard_true(i13, descr=...)
guard_not_invalidated(descr=...)
# the bound check guard on img has been killed (thanks to the asserts)
i14 = getarrayitem_raw_i(i10, i8, descr=<ArrayS .>)
# advanced: the following int_add cannot overflow, because:
# - i14 fits inside 32 bits
# - i9 fits inside 33 bits, because:
# - it comes from the previous iteration's i15
# - prev i19 = prev i18 + prev i15
# - prev i18 fits inside 32 bits
# - prev i19 is guarded to fit inside 32 bits
# - so as a consequence, prev i15 fits inside 33 bits
# the new i15 thus fits inside "33.5" bits, which is enough to
# guarantee that the next int_add(i18, i15) cannot overflow either...
i15 = int_add(i9, i14)
i17 = int_add(i8, -640)
# the bound check guard on intimg has been killed (thanks to the asserts)
i18 = getarrayitem_raw_i(i11, i17, descr=<ArrayS .>)
i19 = int_add(i18, i15)
# guard checking that i19 actually fits into 32bit
i20 = int_signext(i19, 4)
i65 = int_ne(i20, i19)
guard_false(i65, descr=...)
setarrayitem_raw(i11, i8, _, descr=<ArrayS .>)
i28 = int_add(i8, 1)
guard_not_invalidated?
ticker0 = getfield_raw_i(#, descr=<FieldS pypysig_long_struct_inner.c_value .*>)
ticker_cond0 = int_lt(ticker0, 0)
guard_false(ticker_cond0, descr=...)
jump(..., descr=...)
__________________________ TestBuffers.test_re_match ___________________________
self = <pypy.module.pypyjit.test_pypy_c.test_buffers.TestBuffers object at 0x000000002b47af00>
def test_re_match(self):
def main(n):
import re
import array
p = re.compile(b'.+')
a = array.array('B', b'test' * 1000)
i = 0
while i < n:
i += 1
p.match(a) # ID: match
return i
log = self.run(main, [1000])
assert log.result == 1000
loop, = log.loops_by_filename(self.filepath)
> assert loop.match_by_id('match', """
guard_not_invalidated(descr=...)
p71 = getfield_gc_r(p15, descr=...) # check that the pattern is not None and a W_BytesObject
guard_nonnull_class(p71, ConstClass(W_BytesObject), descr=...)
i74 = instance_ptr_eq(_, p71)
guard_false(i74, descr=...)
i65 = getfield_gc_i(p18, descr=...)
i67 = int_gt(0, i65)
guard_false(i67, descr=...)
i69 = int_gt(#, i65)
guard_true(i69, descr=...)
--TICK--
""")
pypy/module/pypyjit/test_pypy_c/test_buffers.py:19:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pypy/module/pypyjit/test_pypy_c/model.py:182: in match_by_id
return matcher.match(expected_src, ignore_ops=ignore_ops)
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 0x000000002fdbe678>
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 = 'match'
('operation mismatch',)
<could not determine information>
Ignore ops: []
Got:
===== HERE =====
p73 = getfield_gc_r(p14, descr=<FieldP pypy.module._sre.interp_sre.W_SRE_Pattern.inst_w_pattern 56>)
guard_nonnull_class(p73, ConstClass(W_BytesObject), descr=<Guard0xffff7a752a40>)
i76 = instance_ptr_eq(ConstPtr(ptr75), p73)
guard_false(i76, descr=<Guard0xffff7a77deb0>)
i77 = getfield_gc_i(p16, descr=<FieldS pypy.module.array.interp_array.W_ArrayBase.inst__exports 16>)
i79 = int_add(i77, 1)
i80 = getfield_gc_i(p16, descr=<FieldS pypy.module.array.interp_array.W_ArrayBase.inst_len 40>)
i82 = int_gt(0, i80)
guard_false(i82, descr=<Guard0xffff7a77df10>)
i84 = int_gt(9223372036854775807, i80)
guard_true(i84, descr=<Guard0xffff7a77df70>)
guard_not_invalidated(descr=<Guard0xffff7a78a050>)
i99 = getfield_raw_i(281472820911816, descr=<FieldS pypysig_long_struct_inner.c_value 0>)
i101 = int_lt(i99, 0)
guard_false(i101, descr=<Guard0xffff7a78a0b0>)
Expected:
guard_not_invalidated(descr=...)
p71 = getfield_gc_r(p15, descr=...) # check that the pattern is not None and a W_BytesObject
guard_nonnull_class(p71, ConstClass(W_BytesObject), descr=...)
i74 = instance_ptr_eq(_, p71)
guard_false(i74, descr=...)
i65 = getfield_gc_i(p18, descr=...)
i67 = int_gt(0, i65)
guard_false(i67, descr=...)
i69 = int_gt(#, i65)
guard_true(i69, descr=...)
guard_not_invalidated?
ticker0 = getfield_raw_i(#, descr=<FieldS pypysig_long_struct_inner.c_value .*>)
ticker_cond0 = int_lt(ticker0, 0)
guard_false(ticker_cond0, descr=...)
________________________ TestBuffers.test_struct_unpack ________________________
self = <pypy.module.pypyjit.test_pypy_c.test_buffers.TestBuffers object at 0x000000002c7085d0>
def test_struct_unpack(self):
def main(n):
import _struct as struct
import array
a = array.array('B', struct.pack('i', 42))
i = 0
while i < n:
i += 1
struct.unpack('i', a) # ID: unpack
return i
log = self.run(main, [1000])
assert log.result == 1000
loop, = log.loops_by_filename(self.filepath)
> assert loop.match_by_id('unpack', """
guard_not_invalidated(descr=...)
i66 = raw_load_i(i53, 0, descr=<ArrayS 4>)
--TICK--
""")
pypy/module/pypyjit/test_pypy_c/test_buffers.py:46:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pypy/module/pypyjit/test_pypy_c/model.py:182: in match_by_id
return matcher.match(expected_src, ignore_ops=ignore_ops)
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 0x000000002f38d130>
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 = 'unpack'
('operation mismatch',)
<could not determine information>
Ignore ops: []
Got:
===== HERE =====
i66 = raw_load_i(i53, 0, descr=<ArrayS 4>)
i68 = getfield_raw_i(281473722687176, descr=<FieldS pypysig_long_struct_inner.c_value 0>)
i70 = int_lt(i68, 0)
guard_false(i70, descr=<Guard0xffffb06164a0>)
Expected:
guard_not_invalidated(descr=...)
i66 = raw_load_i(i53, 0, descr=<ArrayS 4>)
guard_not_invalidated?
ticker0 = getfield_raw_i(#, descr=<FieldS pypysig_long_struct_inner.c_value .*>)
ticker_cond0 = int_lt(ticker0, 0)
guard_false(ticker_cond0, descr=...)
__________________________ TestCall.test_simple_call ___________________________
self = <pypy.module.pypyjit.test_pypy_c.test_call.TestCall object at 0x0000000029a0fe50>
def test_simple_call(self):
src = """
OFFSET = 0
def f(i):
return i + 1 + OFFSET # ID: add
def main(n):
i = 0
while i < n+OFFSET: # ID: cond
i = f(f(i)) # ID: call
a = 0
return i
"""
log = self.run(src, [1000])
assert log.result == 1000
# first, we test what is inside the entry bridge
# -----------------------------------------------
entry_bridge, = log.loops_by_id('call', is_entry_bridge=True)
# LOAD_GLOBAL of OFFSET
ops = entry_bridge.ops_by_id('cond', opcode='LOAD_GLOBAL')
assert log.opnames(ops) == ["guard_value",
> "guard_not_invalidated"]
E assert [] == ['guard_value', 'guard_not_invalidated']
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:75: AssertionError
__________________________ 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
____________________ TestCall.test_static_classmethod_call _____________________
self = <pypy.module.pypyjit.test_pypy_c.test_call.TestCall object at 0x000000002a06cfa8>
def test_static_classmethod_call(self):
def fn(n):
class A(object):
@classmethod
def f(cls, i):
return i + (cls is A) + 1
@staticmethod
def g(i):
return i - 1
#
i = 0
a = A()
while i < n:
x = a.f(i)
i = a.g(x)
return i
#
log = self.run(fn, [1000])
assert log.result == 1000
loop, = log.loops_by_filename(self.filepath)
> assert loop.match("""
i14 = int_lt(i6, i9)
guard_true(i14, descr=...)
guard_not_invalidated(descr=...)
i15 = force_token()
i17 = int_add_ovf(i8, 1)
guard_no_overflow(descr=...)
i18 = force_token()
--TICK--
jump(..., descr=...)
""")
pypy/module/pypyjit/test_pypy_c/test_call.py:177:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
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 0x000000002a2ebfa0>
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=<Guard0xffff7e7c0bf0>)
i60 = int_lt(i47, i30)
guard_true(i60, descr=<Guard0xffff7e7e13a0>)
p61 = force_token()
i65 = int_add_ovf(i59, 1)
guard_no_overflow(descr=<Guard0xffff7e7e13d0>)
p67 = force_token()
i72 = getfield_raw_i(281472885923528, descr=<FieldS pypysig_long_struct_inner.c_value 0>)
i74 = int_lt(i72, 0)
guard_false(i74, descr=<Guard0xffff7e7e1430>)
jump(p0, p1, p8, i59, p12, i65, p16, p24, i30, p37, i65, descr=TargetToken(281472803791456))
Expected:
i14 = int_lt(i6, i9)
guard_true(i14, descr=...)
guard_not_invalidated(descr=...)
i15 = force_token()
i17 = int_add_ovf(i8, 1)
guard_no_overflow(descr=...)
i18 = force_token()
guard_not_invalidated?
ticker0 = getfield_raw_i(#, descr=<FieldS pypysig_long_struct_inner.c_value .*>)
ticker_cond0 = int_lt(ticker0, 0)
guard_false(ticker_cond0, descr=...)
jump(..., descr=...)
__________________________ TestCall.test_kwargs_empty __________________________
self = <pypy.module.pypyjit.test_pypy_c.test_call.TestCall object at 0x000000002ac10e90>
def test_kwargs_empty(self):
def main(x):
def g(**args):
return len(args) + 1
#
s = 0
d = {}
i = 0
while i < x:
s += g(**d) # ID: call
i += 1
return s
#
log = self.run(main, [1000])
assert log.result == 1000
loop, = log.loops_by_id('call')
ops = log.opnames(loop.ops_by_id('call'))
guards = [ops for ops in ops if ops.startswith('guard')]
> assert guards == ["guard_not_invalidated", "guard_no_overflow"]
E assert ['guard_no_overflow'] == ['guard_not_invali...guard_no_overflow']
E At index 0 diff: 'guard_no_overflow' != 'guard_not_invalidated'
E Right contains more items, first extra item: 'guard_no_overflow'
E Use -v to get the full diff
pypy/module/pypyjit/test_pypy_c/test_call.py:227: AssertionError
_________________________ TestCall.test_func_defaults __________________________
self = <pypy.module.pypyjit.test_pypy_c.test_call.TestCall object at 0x000000002f0cad40>
def test_func_defaults(self):
def main(n):
i = 1
while i < n:
i += len(range(i+1)) - i
return i
log = self.run(main, [10000])
assert log.result == 10000
loop, = log.loops_by_filename(self.filepath)
> assert loop.match("""
i10 = int_lt(i5, i6)
guard_true(i10, descr=...)
guard_not_invalidated(descr=...)
i120 = int_add(i5, 1)
--TICK--
jump(..., descr=...)
""")
pypy/module/pypyjit/test_pypy_c/test_call.py:414:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
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 0x000000002d3d25d0>
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=<Guard0xffff8eca2ba8>)
i36 = int_lt(i29, i26)
guard_true(i36, descr=<Guard0xffff8ecc2260>)
i38 = int_add(i29, 1)
i40 = getfield_raw_i(281473158553288, descr=<FieldS pypysig_long_struct_inner.c_value 0>)
i42 = int_lt(i40, 0)
guard_false(i42, descr=<Guard0xffff8ecc22c0>)
jump(p0, p1, p8, i38, i26, descr=TargetToken(281473077346912))
Expected:
i10 = int_lt(i5, i6)
guard_true(i10, descr=...)
guard_not_invalidated(descr=...)
i120 = int_add(i5, 1)
guard_not_invalidated?
ticker0 = getfield_raw_i(#, descr=<FieldS pypysig_long_struct_inner.c_value .*>)
ticker_cond0 = int_lt(ticker0, 0)
guard_false(ticker_cond0, descr=...)
jump(..., descr=...)
_______________ TestCall.test_global_closure_has_constant_cells ________________
self = <pypy.module.pypyjit.test_pypy_c.test_call.TestCall object at 0x000000002d12d6a8>
def test_global_closure_has_constant_cells(self):
log = self.run("""
def make_adder(n):
def add(x):
return x + n
return add
add5 = make_adder(5)
def main():
i = 0
while i < 5000:
i = add5(i) # ID: call
""", [])
loop, = log.loops_by_id('call', is_entry_bridge=True)
> assert loop.match("""
guard_value(i4, 1, descr=...)
guard_isnull(p5, descr=...)
guard_nonnull_class(p12, ConstClass(W_IntObject), descr=...)
guard_value(p2, ConstPtr(ptr21), descr=...)
i22 = getfield_gc_i(p12, descr=<FieldS pypy.objspace.std.intobject.W_IntObject.inst_intval .*>)
i24 = int_lt(i22, 5000)
guard_true(i24, descr=...)
dummy_get_utf8?
guard_not_invalidated(descr=...)
p29 = call_r(ConstClass(_ll_1_threadlocalref_get__Ptr_GcStruct_objectLlT_Signed), #, descr=<Callr . i EF=1 OS=5>)
p30 = getfield_gc_r(p29, descr=<FieldP pypy.interpreter.executioncontext.ExecutionContext.inst_topframeref .*>)
p31 = force_token()
p32 = getfield_gc_r(p29, descr=<FieldP pypy.interpreter.executioncontext.ExecutionContext.inst_w_tracefunc .*>)
guard_value(p32, ConstPtr(ptr33), descr=...)
i34 = getfield_gc_i(p29, descr=<FieldU pypy.interpreter.executioncontext.ExecutionContext.inst_profilefunc .*>)
i35 = int_is_zero(i34)
guard_true(i35, descr=...)
i40 = int_add(i22, 5)
--TICK--
""")
pypy/module/pypyjit/test_pypy_c/test_call.py:436:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
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 0x000000002e607750>
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:
guard_value(i4, 1, descr=<Guard0xffffaeba0a88>)
===== HERE =====
guard_value(p3, ConstPtr(ptr14), descr=<Guard0xffffaebc2290>)
guard_not_invalidated(descr=<Guard0xffffaebc22c0>)
guard_isnull(p5, descr=<Guard0xffffaebc2320>)
guard_nonnull_class(p8, ConstClass(W_IntObject), descr=<Guard0xffffaeba0ad0>)
i16 = getfield_gc_i(p8, descr=<FieldS pypy.objspace.std.intobject.W_IntObject.inst_intval 8 pure>)
i18 = int_lt(i16, 5000)
guard_true(i18, descr=<Guard0xffffaebc2380>)
p21 = call_r(ConstClass(_ll_1_threadlocalref_get__Ptr_GcStruct_objectLlT_Signed), 64, descr=<Callr 8 i EF=1 OS=5>)
p22 = getfield_gc_r(p21, descr=<FieldP pypy.interpreter.executioncontext.ExecutionContext.inst_topframeref 136>)
p23 = force_token()
p24 = getfield_gc_r(p21, descr=<FieldP pypy.interpreter.executioncontext.ExecutionContext.inst_w_tracefunc 176 pure>)
guard_value(p24, ConstPtr(null), descr=<Guard0xffffaeba0b18>)
i26 = getfield_gc_i(p21, descr=<FieldU pypy.interpreter.executioncontext.ExecutionContext.inst_profilefunc 186 pure>)
i27 = int_is_zero(i26)
guard_true(i27, descr=<Guard0xffffaebc23e0>)
i31 = int_add(i16, 5)
i34 = getfield_raw_i(281473695424200, descr=<FieldS pypysig_long_struct_inner.c_value 0>)
i36 = int_lt(i34, 0)
guard_false(i36, descr=<Guard0xffffaebc2440>)
Expected:
guard_value(i4, 1, descr=...)
guard_isnull(p5, descr=...)
guard_nonnull_class(p12, ConstClass(W_IntObject), descr=...)
guard_value(p2, ConstPtr(ptr21), descr=...)
i22 = getfield_gc_i(p12, descr=<FieldS pypy.objspace.std.intobject.W_IntObject.inst_intval .*>)
i24 = int_lt(i22, 5000)
guard_true(i24, descr=...)
dummy_get_utf8?
guard_not_invalidated(descr=...)
p29 = call_r(ConstClass(_ll_1_threadlocalref_get__Ptr_GcStruct_objectLlT_Signed), #, descr=<Callr . i EF=1 OS=5>)
p30 = getfield_gc_r(p29, descr=<FieldP pypy.interpreter.executioncontext.ExecutionContext.inst_topframeref .*>)
p31 = force_token()
p32 = getfield_gc_r(p29, descr=<FieldP pypy.interpreter.executioncontext.ExecutionContext.inst_w_tracefunc .*>)
guard_value(p32, ConstPtr(ptr33), descr=...)
i34 = getfield_gc_i(p29, descr=<FieldU pypy.interpreter.executioncontext.ExecutionContext.inst_profilefunc .*>)
i35 = int_is_zero(i34)
guard_true(i35, descr=...)
i40 = int_add(i22, 5)
guard_not_invalidated?
ticker0 = getfield_raw_i(#, descr=<FieldS pypysig_long_struct_inner.c_value .*>)
ticker_cond0 = int_lt(ticker0, 0)
guard_false(ticker_cond0, descr=...)
____________________ TestCall.test_local_closure_is_virtual ____________________
self = <pypy.module.pypyjit.test_pypy_c.test_call.TestCall object at 0x000000002b576560>
def test_local_closure_is_virtual(self):
log = self.run("""
def main():
i = 0
while i < 5000:
def add():
return i + 1
i = add() # ID: call
""", [])
loop, = log.loops_by_id('call')
> assert loop.match("""
i8 = getfield_gc_i(p6, descr=<FieldS pypy.objspace.std.intobject.W_IntObject.inst_intval .*>)
i10 = int_lt(i8, 5000)
guard_true(i10, descr=...)
guard_not_invalidated?
i11 = force_token()
i13 = int_add(i8, 1)
--TICK--
p22 = new_with_vtable(descr=<SizeDescr .*>)
setfield_gc(p22, i13, descr=<FieldS pypy.objspace.std.intobject.W_IntObject.inst_intval .*>)
setfield_gc(p4, p22, descr=<FieldP pypy.interpreter.nestedscope.Cell.inst_w_value .*>)
jump(..., descr=...)
""")
pypy/module/pypyjit/test_pypy_c/test_call.py:468:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
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 0x000000002dd2e410>
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=<Guard0xffff80844bf0>)
i44 = getfield_gc_i(p43, descr=<FieldS pypy.objspace.std.intobject.W_IntObject.inst_intval 8 pure>)
i46 = int_lt(i44, 5000)
guard_true(i46, descr=<Guard0xffff808629e0>)
p47 = force_token()
i51 = int_add(i44, 1)
i54 = getfield_raw_i(281472919477960, descr=<FieldS pypysig_long_struct_inner.c_value 0>)
i56 = int_lt(i54, 0)
guard_false(i56, descr=<Guard0xffff80862a40>)
p57 = new_with_vtable(descr=<SizeDescr 16>)
setfield_gc(p57, i51, descr=<FieldS pypy.objspace.std.intobject.W_IntObject.inst_intval 8 pure>)
setfield_gc(p10, p57, descr=<FieldP pypy.interpreter.nestedscope.Cell.inst_w_value 16>)
jump(p0, p1, p10, p57, p25, p37, descr=TargetToken(281472837886624))
Expected:
i8 = getfield_gc_i(p6, descr=<FieldS pypy.objspace.std.intobject.W_IntObject.inst_intval .*>)
i10 = int_lt(i8, 5000)
guard_true(i10, descr=...)
guard_not_invalidated?
i11 = force_token()
i13 = int_add(i8, 1)
guard_not_invalidated?
ticker0 = getfield_raw_i(#, descr=<FieldS pypysig_long_struct_inner.c_value .*>)
ticker_cond0 = int_lt(ticker0, 0)
guard_false(ticker_cond0, descr=...)
p22 = new_with_vtable(descr=<SizeDescr .*>)
setfield_gc(p22, i13, descr=<FieldS pypy.objspace.std.intobject.W_IntObject.inst_intval .*>)
setfield_gc(p4, p22, descr=<FieldP pypy.interpreter.nestedscope.Cell.inst_w_value .*>)
jump(..., descr=...)
_________________________ TestCall.test_kwargs_virtual _________________________
self = <pypy.module.pypyjit.test_pypy_c.test_call.TestCall object at 0x000000002d54e1a8>
def test_kwargs_virtual(self):
def main(n):
def g(**kwargs):
return kwargs["x"] + 1
i = 0
while i < n:
i = g(x=i)
return i
log = self.run(main, [500])
assert log.result == 500
loop, = log.loops_by_filename(self.filepath)
> assert loop.match("""
i2 = int_lt(i0, i1)
guard_true(i2, descr=...)
guard_not_invalidated?
i3 = force_token()
i4 = int_add(i0, 1)
--TICK--
jump(..., descr=...)
""")
pypy/module/pypyjit/test_pypy_c/test_call.py:495:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
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 0x00000000308467c8>
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=<Guard0xffffb7d5ebf0>)
i54 = int_lt(i48, i24)
guard_true(i54, descr=<Guard0xffffb7d7cb30>)
p55 = force_token()
i59 = int_add(i48, 1)
i62 = getfield_raw_i(281473848516296, descr=<FieldS pypysig_long_struct_inner.c_value 0>)
i64 = int_lt(i62, 0)
guard_false(i64, descr=<Guard0xffffb7d7cb90>)
jump(p0, p1, p8, p10, i59, i24, p38, descr=TargetToken(281473765982880))
Expected:
i2 = int_lt(i0, i1)
guard_true(i2, descr=...)
guard_not_invalidated?
i3 = force_token()
i4 = int_add(i0, 1)
guard_not_invalidated?
ticker0 = getfield_raw_i(#, descr=<FieldS pypysig_long_struct_inner.c_value .*>)
ticker_cond0 = int_lt(ticker0, 0)
guard_false(ticker_cond0, descr=...)
jump(..., descr=...)
________________________ TestCall.test_kwargs_virtual2 _________________________
self = <pypy.module.pypyjit.test_pypy_c.test_call.TestCall object at 0x0000000029797a98>
def test_kwargs_virtual2(self):
log = self.run("""
def f(*args, **kwargs):
kwargs['a'] = kwargs['z'] * 0
return g(1, *args, **kwargs)
def g(x, y, z=2, a=1):
return x - y + z + a
def main(stop):
res = 0
i = 0
while i < stop:
res = f(res, z=i) # ID: call
i += 1
return res""", [1000])
assert log.result == 500
loop, = log.loops_by_id('call')
> assert loop.match("""
i65 = int_lt(i58, i29)
guard_true(i65, descr=...)
guard_not_invalidated(..., descr=...)
i66 = force_token()
i67 = force_token()
i69 = int_sub_ovf(1, i56)
guard_no_overflow(..., descr=...)
i70 = int_add_ovf(i69, i58)
guard_no_overflow(..., descr=...)
i71 = int_add(i58, 1)
--TICK--
jump(..., descr=...)
""")
pypy/module/pypyjit/test_pypy_c/test_call.py:523:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
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 0x000000002d7dd088>
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=<Guard0xffff8dba0c38>)
i55 = int_lt(i50, i26)
guard_true(i55, descr=<Guard0xffff8dbcce00>)
p56 = force_token()
p59 = force_token()
i63 = int_sub_ovf(1, i46)
guard_no_overflow(descr=<Guard0xffff8dbcce30>)
i64 = int_add_ovf(i63, i50)
guard_no_overflow(descr=<Guard0xffff8dbcce60>)
i68 = int_add(i50, 1)
i70 = getfield_raw_i(281473141776072, descr=<FieldS pypysig_long_struct_inner.c_value 0>)
i72 = int_lt(i70, 0)
guard_false(i72, descr=<Guard0xffff8dbccec0>)
jump(p0, p1, p8, i64, i68, i26, p31, descr=TargetToken(281473059512928))
Expected:
i65 = int_lt(i58, i29)
guard_true(i65, descr=...)
guard_not_invalidated(..., descr=...)
i66 = force_token()
i67 = force_token()
i69 = int_sub_ovf(1, i56)
guard_no_overflow(..., descr=...)
i70 = int_add_ovf(i69, i58)
guard_no_overflow(..., descr=...)
i71 = int_add(i58, 1)
guard_not_invalidated?
ticker0 = getfield_raw_i(#, descr=<FieldS pypysig_long_struct_inner.c_value .*>)
ticker_cond0 = int_lt(ticker0, 0)
guard_false(ticker_cond0, descr=...)
jump(..., descr=...)
_____________________ TestCall.test_kwargs_update_virtual1 _____________________
self = <pypy.module.pypyjit.test_pypy_c.test_call.TestCall object at 0x000000002caada28>
def test_kwargs_update_virtual1(self):
log = self.run("""
def f(**kwargs):
return len(kwargs)
def main(stop):
i = 0
res = 0
while i < stop:
d = {'a': 1, 'b': 2}
# used to force the dict!
res += f(c=2, **d) # ID: call
i += 1
return res
""", [1000])
loop, = log.loops_by_id('call')
ops = loop.ops_by_id('call')
assert log.opnames(ops) == ["guard_not_invalidated", "force_token",
> "int_add_ovf", "guard_no_overflow"]
E assert ['force_token..._no_overflow'] == ['guard_not_in..._no_overflow']
E At index 0 diff: 'force_token' != 'guard_not_invalidated'
E Right contains more items, first extra item: 'guard_no_overflow'
E Use -v to get the full diff
pypy/module/pypyjit/test_pypy_c/test_call.py:575: AssertionError
__________________ TestCall.test_methodcall_kwargs_regression __________________
self = <pypy.module.pypyjit.test_pypy_c.test_call.TestCall object at 0x000000002d8d3910>
def test_methodcall_kwargs_regression(self):
log = self.run("""
class A:
def f(self, x, y, z):
return x + y + z
def main():
a = A()
res = 0
for i in range(10000):
a.f(x=i, y=i+1, z=i*2) # ID: meth
res += i
""", [])
loop, = log.loops_by_id('meth')
> assert loop.match_by_id("meth", """
setfield_gc(p15, i65, descr=...)
guard_not_invalidated(descr=...)
i68 = int_mul_ovf(i62, 2)
guard_no_overflow(descr=...)
p69 = force_token()
""")
pypy/module/pypyjit/test_pypy_c/test_call.py:682:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pypy/module/pypyjit/test_pypy_c/model.py:182: in match_by_id
return matcher.match(expected_src, ignore_ops=ignore_ops)
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 0x000000002eda0f38>
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 = 'meth'
('operation mismatch',)
<could not determine information>
Ignore ops: []
Got:
setfield_gc(p14, i64, descr=<FieldS pypy.module.__builtin__.functional.W_IntRangeIterator.inst_current 8>)
===== HERE =====
i66 = int_mul_ovf(i61, 2)
guard_no_overflow(descr=<Guard0xffff898a2bf0>)
p68 = force_token()
Expected:
setfield_gc(p15, i65, descr=...)
guard_not_invalidated(descr=...)
i68 = int_mul_ovf(i62, 2)
guard_no_overflow(descr=...)
p69 = force_token()
__________________ TestException.test_exception_inside_loop_1 __________________
self = <pypy.module.pypyjit.test_pypy_c.test_exception.TestException object at 0x000000002d493e50>
def test_exception_inside_loop_1(self):
def main(n):
while n:
try:
raise ValueError
except ValueError:
pass
n -= 1
return n
#
log = self.run(main, [1000])
assert log.result == 0
loop, = log.loops_by_filename(self.filepath)
> assert loop.match("""
i5 = int_is_true(i3)
guard_true(i5, descr=...)
guard_not_invalidated(descr=...)
--EXC-TICK--
i12 = int_sub_ovf(i3, 1)
guard_no_overflow(descr=...)
--TICK--
jump(..., descr=...)
""")
pypy/module/pypyjit/test_pypy_c/test_exception.py:37:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
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 0x000000002bac2170>
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=<Guard0xffff91412b60>)
i40 = int_is_true(i35)
guard_true(i40, descr=<Guard0xffff91434680>)
i42 = getfield_raw_i(281473200496328, descr=<FieldS pypysig_long_struct_inner.c_value 0>)
i44 = int_lt(i42, 0)
guard_false(i44, descr=<Guard0xffff914346e0>)
i46 = int_sub_ovf(i35, 1)
guard_no_overflow(descr=<Guard0xffff91434710>)
i48 = getfield_raw_i(281473200496328, descr=<FieldS pypysig_long_struct_inner.c_value 0>)
i50 = int_lt(i48, 0)
guard_false(i50, descr=<Guard0xffff91434770>)
jump(p0, p1, i46, p16, p32, descr=TargetToken(281473118700128))
Expected:
i5 = int_is_true(i3)
guard_true(i5, descr=...)
guard_not_invalidated(descr=...)
ticker2 = getfield_raw_i(#, descr=<FieldS pypysig_long_struct_inner.c_value .*>)
ticker_cond1 = int_lt(ticker2, 0)
guard_false(ticker_cond1, descr=...)
i12 = int_sub_ovf(i3, 1)
guard_no_overflow(descr=...)
guard_not_invalidated?
ticker0 = getfield_raw_i(#, descr=<FieldS pypysig_long_struct_inner.c_value .*>)
ticker_cond0 = int_lt(ticker0, 0)
guard_false(ticker_cond0, descr=...)
jump(..., descr=...)
__________________________ TestException.test_reraise __________________________
self = <pypy.module.pypyjit.test_pypy_c.test_exception.TestException object at 0x000000002c1476e0>
def test_reraise(self):
def f(n):
i = 0
while i < n:
try:
try:
raise KeyError
except KeyError:
raise
except KeyError:
i += 1
return i
log = self.run(f, [100000])
assert log.result == 100000
loop, = log.loops_by_filename(self.filepath)
> assert loop.match("""
i7 = int_lt(i4, i5)
guard_true(i7, descr=...)
guard_not_invalidated(descr=...)
--EXC-TICK--
i14 = int_add(i4, 1)
--TICK--
jump(..., descr=...)
""")
pypy/module/pypyjit/test_pypy_c/test_exception.py:85:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
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 0x000000002f948020>
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=<Guard0xffffa74b2ba8>)
i44 = int_lt(i39, i24)
guard_true(i44, descr=<Guard0xffffa74d6980>)
i46 = getfield_raw_i(281473569595080, descr=<FieldS pypysig_long_struct_inner.c_value 0>)
i48 = int_lt(i46, 0)
guard_false(i48, descr=<Guard0xffffa74d69e0>)
i50 = int_add(i39, 1)
i52 = getfield_raw_i(281473569595080, descr=<FieldS pypysig_long_struct_inner.c_value 0>)
i54 = int_lt(i52, 0)
guard_false(i54, descr=<Guard0xffffa74d6a40>)
jump(p0, p1, p8, i50, i24, p36, descr=TargetToken(281473488454240))
Expected:
i7 = int_lt(i4, i5)
guard_true(i7, descr=...)
guard_not_invalidated(descr=...)
ticker2 = getfield_raw_i(#, descr=<FieldS pypysig_long_struct_inner.c_value .*>)
ticker_cond1 = int_lt(ticker2, 0)
guard_false(ticker_cond1, descr=...)
i14 = int_add(i4, 1)
guard_not_invalidated?
ticker0 = getfield_raw_i(#, descr=<FieldS pypysig_long_struct_inner.c_value .*>)
ticker_cond0 = int_lt(ticker0, 0)
guard_false(ticker_cond0, descr=...)
jump(..., descr=...)
____________________ TestException.test_continue_in_finally ____________________
self = <pypy.module.pypyjit.test_pypy_c.test_exception.TestException object at 0x000000002eb6dd70>
def test_continue_in_finally(self):
# check that 'continue' inside a try:finally: block is correctly
# detected as closing a loop
def f(n):
i = 0
while 1:
try:
if i < n:
continue
finally:
i += 1
return i
log = self.run(f, [2000])
assert log.result == 2001
loop, = log.loops_by_filename(self.filepath)
> assert loop.match("""
i3 = int_lt(i1, i2)
guard_true(i3, descr=...)
i4 = int_add(i1, 1)
--TICK--
jump(..., descr=...)
""")
pypy/module/pypyjit/test_pypy_c/test_exception.py:111:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
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 0x000000002e703e88>
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=<Guard0xffffb3a44b60>)
i32 = int_lt(i27, i24)
guard_true(i32, descr=<Guard0xffffb3a53c10>)
i34 = int_add(i27, 1)
i36 = getfield_raw_i(281473777213128, descr=<FieldS pypysig_long_struct_inner.c_value 0>)
i38 = int_lt(i36, 0)
guard_false(i38, descr=<Guard0xffffb3a53c70>)
jump(p0, p1, p8, i34, p16, p18, i24, descr=TargetToken(281473695621728))
Expected:
i3 = int_lt(i1, i2)
guard_true(i3, descr=...)
i4 = int_add(i1, 1)
guard_not_invalidated?
ticker0 = getfield_raw_i(#, descr=<FieldS pypysig_long_struct_inner.c_value .*>)
ticker_cond0 = int_lt(ticker0, 0)
guard_false(ticker_cond0, descr=...)
jump(..., descr=...)
__________________ Test__ffi.test_cffi_init_struct_with_list ___________________
self = <pypy.module.pypyjit.test_pypy_c.test_ffi.Test__ffi object at 0x000000002c3e1b78>
def test_cffi_init_struct_with_list(self):
def main(n):
import sys
try:
import cffi
except ImportError:
sys.stderr.write('SKIP: cannot import cffi\n')
return 0
ffi = cffi.FFI()
ffi.cdef("""
struct s {
short x;
short y;
short z;
};
""")
for i in range(n):
ffi.new("struct s *", [i, i, i])
log = self.run(main, [300])
loop, = log.loops_by_filename(self.filepath)
> assert loop.match("""
i106 = getfield_gc_i(p20, descr=...)
i161 = int_lt(i106, i43)
guard_true(i161, descr=...)
i162 = int_add(i106, 1)
p110 = getfield_gc_r(p16, descr=...)
setfield_gc(p20, i162, descr=...)
guard_value(p110, ConstPtr(ptr111), descr=...)
guard_not_invalidated(descr=...)
p163 = force_token()
p164 = force_token()
p118 = getfield_gc_r(p16, descr=...)
p120 = getarrayitem_gc_r(p118, 0, descr=...)
guard_value(p120, ConstPtr(ptr121), descr=...)
p122 = getfield_gc_r(p120, descr=...)
guard_value(p122, ConstPtr(ptr123), descr=...)
p125 = getfield_gc_r(p16, descr=...)
guard_nonnull_class(p125, ..., descr=...)
p999 = getfield_gc_r(p125, descr=...)
guard_isnull(p999, descr=...)
p127 = getfield_gc_r(p125, descr=...)
guard_value(p127, ConstPtr(ptr128), descr=...)
p129 = getfield_gc_r(p127, descr=...)
guard_value(p129, ConstPtr(ptr130), descr=...)
p132 = call_r(ConstClass(_ll_0_alloc_with_del___), descr=...)
guard_no_exception(descr=...)
p133 = force_token()
p134 = new_with_vtable(descr=...)
setfield_gc(p134, ..., descr=...)
setfield_gc(p134, ConstPtr(null), descr=...)
setfield_gc(p48, p134, descr=...)
setfield_gc(p132, ..., descr=...)
i138 = call_i(ConstClass(_ll_1_raw_malloc_varsize_zero__Signed), 6, descr=...)
check_memory_error(i138)
setfield_gc(p132, i138, descr=...)
setfield_gc(p132, ConstPtr(ptr139), descr=...)
setfield_gc(p132, -1, descr=...)
setfield_gc(p132, 6, descr=...)
setfield_gc(p0, p133, descr=...)
call_may_force_n(ConstClass(_ll_2_gc_add_memory_pressure__Signed_pypy_module__cffi_backend_cdataobj_W_CDataNewStdPtr), 6, p132, descr=...)
guard_not_forced(descr=...)
guard_no_exception(descr=...)
i146 = int_signext(i106, 2)
i147 = int_ne(i106, i146)
guard_false(i147, descr=...)
setarrayitem_raw(i138, 0, i106, descr=...)
i150 = int_add(i138, 2)
setarrayitem_raw(i150, 0, i106, descr=...)
i153 = int_add(i138, 4)
setarrayitem_raw(i153, 0, i106, descr=...)
p156 = getfield_gc_r(p48, descr=...)
...
jump(..., descr=...)
""")
pypy/module/pypyjit/test_pypy_c/test_ffi.py:377:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
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 0x000000002fc66598>
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=<Guard0x3a79cb60>)
i104 = getfield_gc_i(p18, descr=<FieldS pypy.module.__builtin__.functional.W_IntRangeIterator.inst_current 8>)
i105 = int_lt(i104, i35)
guard_true(i105, descr=<Guard0x3a7e6ad0>)
i107 = int_add(i104, 1)
p108 = getfield_gc_r(p14, descr=<FieldP pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable.inst_map 48>)
setfield_gc(p18, i107, descr=<FieldS pypy.module.__builtin__.functional.W_IntRangeIterator.inst_current 8>)
guard_value(p108, ConstPtr(ptr109), descr=<Guard0x3a79cba8>)
p110 = force_token()
p113 = force_token()
p116 = getfield_gc_r(p14, descr=<FieldP pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable.inst__value4 40>)
p118 = getarrayitem_gc_r(p116, 0, descr=<ArrayP 8>)
guard_value(p118, ConstPtr(ptr119), descr=<Guard0x3a79cbf0>)
p120 = getfield_gc_r(p118, descr=<FieldP pypy.objspace.std.dictmultiobject.W_ModuleDictObject.inst_mstrategy 16 pure>)
guard_value(p120, ConstPtr(ptr121), descr=<Guard0x3a79cc38>)
p123 = getfield_gc_r(p14, descr=<FieldP pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable.inst__value0 8>)
guard_nonnull_class(p123, 281473683822976, descr=<Guard0x3a79cc80>)
p125 = getfield_gc_r(p123, descr=<FieldP pypy.interpreter.module.Module.inst_w_userclass 32 pure>)
guard_isnull(p125, descr=<Guard0x3a7e6b30>)
p126 = getfield_gc_r(p123, descr=<FieldP pypy.interpreter.module.Module.inst_w_dict 16 pure>)
guard_value(p126, ConstPtr(ptr127), descr=<Guard0x3a79ccc8>)
p128 = getfield_gc_r(p126, descr=<FieldP pypy.objspace.std.dictmultiobject.W_ModuleDictObject.inst_mstrategy 16 pure>)
guard_value(p128, ConstPtr(ptr129), descr=<Guard0x3a79cd10>)
p131 = call_r(ConstClass(_ll_0_alloc_with_del___), descr=<Callr 8 EF=5>)
guard_no_exception(descr=<Guard0x3a79cd58>)
p132 = force_token()
p133 = new_with_vtable(descr=<SizeDescr 24>)
setfield_gc(p133, p110, descr=<FieldP JitVirtualRef.virtual_token 8>)
setfield_gc(p133, ConstPtr(null), descr=<FieldP JitVirtualRef.forced 16>)
setfield_gc(p44, p133, descr=<FieldP pypy.interpreter.executioncontext.ExecutionContext.inst_topframeref 136>)
setfield_gc(p131, 0, descr=<FieldS pypy.module._cffi_backend.cdataobj.W_CData.special_memory_pressure 32>)
i137 = call_i(ConstClass(_ll_1_raw_malloc_varsize_zero__Signed), 6, descr=<Calli 8 i EF=5 OS=110>)
check_memory_error(i137)
setfield_gc(p131, i137, descr=<FieldU pypy.module._cffi_backend.cdataobj.W_CData.inst__ptr 16 pure>)
setfield_gc(p131, ConstPtr(ptr138), descr=<FieldP pypy.module._cffi_backend.cdataobj.W_CData.inst_ctype 24 pure>)
setfield_gc(p131, -1, descr=<FieldS pypy.module._cffi_backend.cdataobj.W_CDataNewOwning.inst_allocated_length 40 pure>)
setfield_gc(p131, 6, descr=<FieldS pypy.module._cffi_backend.cdataobj.W_CDataNewStd.inst_datasize 48>)
setfield_gc(p0, p132, descr=<FieldP pypy.interpreter.pyframe.PyFrame.vable_token 8>)
call_may_force_n(ConstClass(_ll_2_gc_add_memory_pressure__Signed_pypy_module__cffi_backend_cdataobj_W_CDataNewStdPtr), 6, p131, descr=<Callv 0 ir EF=7>)
guard_not_forced(descr=<Guard0x3a77fe70>)
guard_no_exception(descr=<Guard0x3a7e6b60>)
i144 = int_signext(i104, 2)
i145 = int_ne(i104, i144)
guard_false(i145, descr=<Guard0x3a7e6bc0>)
setarrayitem_raw(i137, 0, i104, descr=<ArrayS 2>)
i148 = int_add(i137, 2)
setarrayitem_raw(i148, 0, i104, descr=<ArrayS 2>)
i151 = int_add(i137, 4)
setarrayitem_raw(i151, 0, i104, descr=<ArrayS 2>)
p154 = getfield_gc_r(p44, descr=<FieldP pypy.interpreter.executioncontext.ExecutionContext.inst_topframeref 136>)
i156 = getfield_raw_i(281473697521352, descr=<FieldS pypysig_long_struct_inner.c_value 0>)
i158 = int_add(i156, -14)
setfield_raw(281473697521352, i158, descr=<FieldS pypysig_long_struct_inner.c_value 0>)
setfield_gc(p44, p45, descr=<FieldP pypy.interpreter.executioncontext.ExecutionContext.inst_topframeref 136>)
setfield_gc(p133, ConstPtr(null), descr=<FieldP JitVirtualRef.virtual_token 8>)
i161 = int_lt(i158, 0)
guard_false(i161, descr=<Guard0x3a79cda0>)
jump(p0, p1, p8, p10, p12, p14, i104, p18, i35, p44, p45, descr=TargetToken(981377056))
Expected:
i106 = getfield_gc_i(p20, descr=...)
i161 = int_lt(i106, i43)
guard_true(i161, descr=...)
i162 = int_add(i106, 1)
p110 = getfield_gc_r(p16, descr=...)
setfield_gc(p20, i162, descr=...)
guard_value(p110, ConstPtr(ptr111), descr=...)
guard_not_invalidated(descr=...)
p163 = force_token()
p164 = force_token()
p118 = getfield_gc_r(p16, descr=...)
p120 = getarrayitem_gc_r(p118, 0, descr=...)
guard_value(p120, ConstPtr(ptr121), descr=...)
p122 = getfield_gc_r(p120, descr=...)
guard_value(p122, ConstPtr(ptr123), descr=...)
p125 = getfield_gc_r(p16, descr=...)
guard_nonnull_class(p125, ..., descr=...)
p999 = getfield_gc_r(p125, descr=...)
guard_isnull(p999, descr=...)
p127 = getfield_gc_r(p125, descr=...)
guard_value(p127, ConstPtr(ptr128), descr=...)
p129 = getfield_gc_r(p127, descr=...)
guard_value(p129, ConstPtr(ptr130), descr=...)
p132 = call_r(ConstClass(_ll_0_alloc_with_del___), descr=...)
guard_no_exception(descr=...)
p133 = force_token()
p134 = new_with_vtable(descr=...)
setfield_gc(p134, ..., descr=...)
setfield_gc(p134, ConstPtr(null), descr=...)
setfield_gc(p48, p134, descr=...)
setfield_gc(p132, ..., descr=...)
i138 = call_i(ConstClass(_ll_1_raw_malloc_varsize_zero__Signed), 6, descr=...)
check_memory_error(i138)
setfield_gc(p132, i138, descr=...)
setfield_gc(p132, ConstPtr(ptr139), descr=...)
setfield_gc(p132, -1, descr=...)
setfield_gc(p132, 6, descr=...)
setfield_gc(p0, p133, descr=...)
call_may_force_n(ConstClass(_ll_2_gc_add_memory_pressure__Signed_pypy_module__cffi_backend_cdataobj_W_CDataNewStdPtr), 6, p132, descr=...)
guard_not_forced(descr=...)
guard_no_exception(descr=...)
i146 = int_signext(i106, 2)
i147 = int_ne(i106, i146)
guard_false(i147, descr=...)
setarrayitem_raw(i138, 0, i106, descr=...)
i150 = int_add(i138, 2)
setarrayitem_raw(i150, 0, i106, descr=...)
i153 = int_add(i138, 4)
setarrayitem_raw(i153, 0, i106, descr=...)
p156 = getfield_gc_r(p48, descr=...)
...
jump(..., descr=...)
____________________ TestGenerators.test_simple_generator1 _____________________
self = <pypy.module.pypyjit.test_pypy_c.test_generators.TestGenerators object at 0x000000002e1314b0>
def test_simple_generator1(self):
def main(n):
def f():
for i in range(10000):
i -= 1
i -= 42 # ID: subtract
yield i
def g():
for i in f(): # ID: generator
pass
g()
log = self.run(main, [500])
loop, = log.loops_by_filename(self.filepath)
> assert loop.match_by_id("generator", """
cond_call(..., descr=...)
i16 = force_token()
setfield_gc(p32, p34, descr=<FieldP pypy.interpreter.executioncontext.ExecutionContext.inst_sys_exc_operror .*>)
setfield_gc(p13, p33, descr=<FieldP pypy.interpreter.generator.GeneratorOrCoroutine.inst_saved_operr .*>)
setfield_gc(p32, p13, descr=<FieldP pypy.interpreter.executioncontext.ExecutionContext.inst_current_gen_or_coroutine .*>)
setfield_gc(p13, 1, descr=<FieldU pypy.interpreter.generator.GeneratorOrCoroutine.inst_running .*>)
setfield_gc(p13, p35, descr=<FieldP pypy.interpreter.generator.GeneratorOrCoroutine.inst_previous_gen_or_coroutine .*>)
setfield_gc(p20, p38, descr=<FieldP pypy.interpreter.pyframe.PyFrame.inst_f_backref .*>)
guard_not_invalidated(descr=...)
p45 = new_with_vtable(descr=<.*>)
ifoo = arraylen_gc(p8, descr=<ArrayP .*>)
setfield_gc(p45, i29, descr=<FieldS .*>)
setarrayitem_gc(p8, 0, p45, descr=<ArrayP .>)
jump(..., descr=...)
""")
pypy/module/pypyjit/test_pypy_c/test_generators.py:21:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pypy/module/pypyjit/test_pypy_c/model.py:182: in match_by_id
return matcher.match(expected_src, ignore_ops=ignore_ops)
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 0x000000002bf3cb10>
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 = 'generator'
('operation mismatch',)
<could not determine information>
Ignore ops: []
Got:
===== HERE =====
guard_not_invalidated(descr=<Guard0xffffa1da0d58>)
cond_call(i25, 281473455214720, p20, descr=<Callv 0 r EF=2 OS=121>)
p98 = force_token()
p125 = new_with_vtable(descr=<SizeDescr 16>)
i126 = arraylen_gc(p49, descr=<ArrayP 8>)
setfield_gc(p125, i115, descr=<FieldS pypy.objspace.std.intobject.W_IntObject.inst_intval 8 pure>)
setarrayitem_gc(p49, 0, p125, descr=<ArrayP 8>)
jump(p0, p1, p125, p10, p12, p20, i25, p32, p49, p34, p33, p35, p38, p68, i109, i71, descr=TargetToken(281473397154464))
Expected:
cond_call(..., descr=...)
i16 = force_token()
setfield_gc(p32, p34, descr=<FieldP pypy.interpreter.executioncontext.ExecutionContext.inst_sys_exc_operror .*>)
setfield_gc(p13, p33, descr=<FieldP pypy.interpreter.generator.GeneratorOrCoroutine.inst_saved_operr .*>)
setfield_gc(p32, p13, descr=<FieldP pypy.interpreter.executioncontext.ExecutionContext.inst_current_gen_or_coroutine .*>)
setfield_gc(p13, 1, descr=<FieldU pypy.interpreter.generator.GeneratorOrCoroutine.inst_running .*>)
setfield_gc(p13, p35, descr=<FieldP pypy.interpreter.generator.GeneratorOrCoroutine.inst_previous_gen_or_coroutine .*>)
setfield_gc(p20, p38, descr=<FieldP pypy.interpreter.pyframe.PyFrame.inst_f_backref .*>)
guard_not_invalidated(descr=...)
p45 = new_with_vtable(descr=<.*>)
ifoo = arraylen_gc(p8, descr=<ArrayP .*>)
setfield_gc(p45, i29, descr=<FieldS .*>)
setarrayitem_gc(p8, 0, p45, descr=<ArrayP .>)
jump(..., descr=...)
____________________ TestGenerators.test_simple_generator2 _____________________
self = <pypy.module.pypyjit.test_pypy_c.test_generators.TestGenerators object at 0x000000002d9bd168>
def test_simple_generator2(self):
def main(n):
def f():
for i in range(1, 10000):
i -= 1
i -= 42 # ID: subtract
yield i
def g():
for i in f(): # ID: generator
pass
g()
log = self.run(main, [500])
loop, = log.loops_by_filename(self.filepath)
> assert loop.match_by_id("generator", """
cond_call(..., descr=...)
i16 = force_token()
setfield_gc(p32, p34, descr=<FieldP pypy.interpreter.executioncontext.ExecutionContext.inst_sys_exc_operror .*>)
setfield_gc(p13, p33, descr=<FieldP pypy.interpreter.generator.GeneratorOrCoroutine.inst_saved_operr .*>)
setfield_gc(p32, p13, descr=<FieldP pypy.interpreter.executioncontext.ExecutionContext.inst_current_gen_or_coroutine .*>)
setfield_gc(p13, 1, descr=<FieldU pypy.interpreter.generator.GeneratorOrCoroutine.inst_running .*>)
setfield_gc(p13, p35, descr=<FieldP pypy.interpreter.generator.GeneratorOrCoroutine.inst_previous_gen_or_coroutine .*>)
setfield_gc(p20, p38, descr=<FieldP pypy.interpreter.pyframe.PyFrame.inst_f_backref .*>)
guard_not_invalidated(descr=...)
p45 = new_with_vtable(descr=<.*>)
i47 = arraylen_gc(p8, descr=<ArrayP .>) # Should be removed by backend
setfield_gc(p45, i29, descr=<FieldS .*>)
setarrayitem_gc(p8, 0, p45, descr=<ArrayP .>)
jump(..., descr=...)
""")
pypy/module/pypyjit/test_pypy_c/test_generators.py:60:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pypy/module/pypyjit/test_pypy_c/model.py:182: in match_by_id
return matcher.match(expected_src, ignore_ops=ignore_ops)
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 0x0000000030fb0790>
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 = 'generator'
('operation mismatch',)
<could not determine information>
Ignore ops: []
Got:
===== HERE =====
guard_not_invalidated(descr=<Guard0xffff9deb2da0>)
cond_call(i25, 281473388105856, p20, descr=<Callv 0 r EF=2 OS=121>)
p98 = force_token()
p125 = new_with_vtable(descr=<SizeDescr 16>)
i126 = arraylen_gc(p49, descr=<ArrayP 8>)
setfield_gc(p125, i115, descr=<FieldS pypy.objspace.std.intobject.W_IntObject.inst_intval 8 pure>)
setarrayitem_gc(p49, 0, p125, descr=<ArrayP 8>)
jump(p0, p1, p125, p10, p12, p20, i25, p32, p49, p34, p33, p35, p38, p68, i109, i71, descr=TargetToken(281473331167840))
Expected:
cond_call(..., descr=...)
i16 = force_token()
setfield_gc(p32, p34, descr=<FieldP pypy.interpreter.executioncontext.ExecutionContext.inst_sys_exc_operror .*>)
setfield_gc(p13, p33, descr=<FieldP pypy.interpreter.generator.GeneratorOrCoroutine.inst_saved_operr .*>)
setfield_gc(p32, p13, descr=<FieldP pypy.interpreter.executioncontext.ExecutionContext.inst_current_gen_or_coroutine .*>)
setfield_gc(p13, 1, descr=<FieldU pypy.interpreter.generator.GeneratorOrCoroutine.inst_running .*>)
setfield_gc(p13, p35, descr=<FieldP pypy.interpreter.generator.GeneratorOrCoroutine.inst_previous_gen_or_coroutine .*>)
setfield_gc(p20, p38, descr=<FieldP pypy.interpreter.pyframe.PyFrame.inst_f_backref .*>)
guard_not_invalidated(descr=...)
p45 = new_with_vtable(descr=<.*>)
i47 = arraylen_gc(p8, descr=<ArrayP .>) # Should be removed by backend
setfield_gc(p45, i29, descr=<FieldS .*>)
setarrayitem_gc(p8, 0, p45, descr=<ArrayP .>)
jump(..., descr=...)
________________________ TestGetFrame.test_getframe_one ________________________
self = <pypy.module.pypyjit.test_pypy_c.test_getframe.TestGetFrame object at 0x000000002a502138>
def test_getframe_one(self):
def main(n):
import sys
i = 0
while i < n:
assert sys._getframe(0).f_code.co_filename == __file__
i += 1
return i
log = self.run(main, [300])
assert log.result == 300
loop, = log.loops_by_filename(self.filepath)
> assert loop.match("""
i54 = int_lt(i47, i28)
guard_true(i54, descr=...)
guard_not_invalidated(descr=...)
i55 = int_add(i47, 1)
--TICK--
jump(..., descr=...)
""")
pypy/module/pypyjit/test_pypy_c/test_getframe.py:18:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
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 0x000000002fd69d00>
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=<Guard0xffff9217ed10>)
i47 = int_lt(i42, i24)
guard_true(i47, descr=<Guard0xffff9219c350>)
i49 = int_add(i42, 1)
i51 = getfield_raw_i(281473215176392, descr=<FieldS pypysig_long_struct_inner.c_value 0>)
i53 = int_lt(i51, 0)
guard_false(i53, descr=<Guard0xffff9219c3b0>)
jump(p0, p1, p8, p10, i49, i24, p34, descr=TargetToken(281473132773984))
Expected:
i54 = int_lt(i47, i28)
guard_true(i54, descr=...)
guard_not_invalidated(descr=...)
i55 = int_add(i47, 1)
guard_not_invalidated?
ticker0 = getfield_raw_i(#, descr=<FieldS pypysig_long_struct_inner.c_value .*>)
ticker_cond0 = int_lt(ticker0, 0)
guard_false(ticker_cond0, descr=...)
jump(..., descr=...)
________________________ TestGlobals.test_load_builtin _________________________
self = <pypy.module.pypyjit.test_pypy_c.test_globals.TestGlobals object at 0x000000002cf67de0>
def test_load_builtin(self):
def main(n):
import pypyjit
i = 0
while i < n:
l = len # ID: loadglobal
i += pypyjit.residual_call(l, "a")
return i
#
log = self.run(main, [500])
assert log.result == 500
loop, = log.loops_by_filename(self.filepath)
> assert loop.match_by_id("loadglobal", """
guard_not_invalidated(descr=...)
""")
pypy/module/pypyjit/test_pypy_c/test_globals.py:18:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pypy/module/pypyjit/test_pypy_c/model.py:182: in match_by_id
return matcher.match(expected_src, ignore_ops=ignore_ops)
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:408: in match_op
self._assert(op != '--end--', 'got less ops than expected')
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.pypyjit.test_pypy_c.model.OpMatcher object at 0x000000002dc0d670>
cond = False, message = 'got less ops than expected'
def _assert(self, cond, message):
if not cond:
> raise InvalidMatch(message, frame=sys._getframe(1))
E InvalidMatch: got less ops than expected
pypy/module/pypyjit/test_pypy_c/model.py:402: InvalidMatch
----------------------------- Captured stdout call -----------------------------
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Loops don't match
=================
loop id = 'loadglobal'
('got less ops than expected',)
<could not determine information>
Ignore ops: []
Got:
===== HERE =====
Expected:
guard_not_invalidated(descr=...)
______________________ TestImport.test_import_in_function ______________________
self = <pypy.module.pypyjit.test_pypy_c.test_import.TestImport object at 0x0000000030756c60>
def test_import_in_function(self):
def main(n):
i = 0
while i < n:
from sys import version # ID: import
i += 1
return i
#
log = self.run(main, [500])
assert log.result == 500
loop, = log.loops_by_id('import')
> assert loop.match_by_id('import', """
guard_not_invalidated(descr=...)
""")
pypy/module/pypyjit/test_pypy_c/test_import.py:17:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pypy/module/pypyjit/test_pypy_c/model.py:182: in match_by_id
return matcher.match(expected_src, ignore_ops=ignore_ops)
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:408: in match_op
self._assert(op != '--end--', 'got less ops than expected')
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.pypyjit.test_pypy_c.model.OpMatcher object at 0x000000002d324090>
cond = False, message = 'got less ops than expected'
def _assert(self, cond, message):
if not cond:
> raise InvalidMatch(message, frame=sys._getframe(1))
E InvalidMatch: got less ops than expected
pypy/module/pypyjit/test_pypy_c/model.py:402: InvalidMatch
----------------------------- Captured stdout call -----------------------------
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Loops don't match
=================
loop id = 'import'
('got less ops than expected',)
<could not determine information>
Ignore ops: []
Got:
===== HERE =====
Expected:
guard_not_invalidated(descr=...)
___________________ TestImport.test___import___has_fast_path ___________________
self = <pypy.module.pypyjit.test_pypy_c.test_import.TestImport object at 0x000000002d5aa870>
def test___import___has_fast_path(self):
def main(n):
i = 0
while i < n:
__import__('sys') # ID: import
i += 1
return i
log = self.run(main, [500])
assert log.result == 500
loop, = log.loops_by_id('import')
> assert loop.match_by_id('import', """
guard_not_invalidated(descr=...)
""")
pypy/module/pypyjit/test_pypy_c/test_import.py:76:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pypy/module/pypyjit/test_pypy_c/model.py:182: in match_by_id
return matcher.match(expected_src, ignore_ops=ignore_ops)
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:408: in match_op
self._assert(op != '--end--', 'got less ops than expected')
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.pypyjit.test_pypy_c.model.OpMatcher object at 0x000000002d9494e8>
cond = False, message = 'got less ops than expected'
def _assert(self, cond, message):
if not cond:
> raise InvalidMatch(message, frame=sys._getframe(1))
E InvalidMatch: got less ops than expected
pypy/module/pypyjit/test_pypy_c/model.py:402: InvalidMatch
----------------------------- Captured stdout call -----------------------------
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Loops don't match
=================
loop id = 'import'
('got less ops than expected',)
<could not determine information>
Ignore ops: []
Got:
===== HERE =====
Expected:
guard_not_invalidated(descr=...)
______________________ TestInstance.test_virtual_instance ______________________
self = <pypy.module.pypyjit.test_pypy_c.test_instance.TestInstance object at 0x000000002b220100>
def test_virtual_instance(self):
def main(n):
class A(object):
pass
#
i = 0
while i < n:
a = A()
assert isinstance(a, A)
assert not isinstance(a, int)
a.x = 2
i = i + a.x
return i
#
log = self.run(main, [1000], threshold = 400)
assert log.result == 1000
loop, = log.loops_by_filename(self.filepath)
> assert loop.match("""
i7 = int_lt(i5, i6)
guard_true(i7, descr=...)
guard_not_invalidated(descr=...)
i9 = int_add_ovf(i5, 2)
guard_no_overflow(descr=...)
--TICK--
jump(..., descr=...)
""")
pypy/module/pypyjit/test_pypy_c/test_instance.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
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 0x000000002b262de8>
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=<Guard0xffff9b7e44a0>)
i37 = int_lt(i32, i28)
guard_true(i37, descr=<Guard0xffff9b7df340>)
i39 = int_add_ovf(i32, 2)
guard_no_overflow(descr=<Guard0xffff9b7df370>)
i41 = getfield_raw_i(281473372462792, descr=<FieldS pypysig_long_struct_inner.c_value 0>)
i43 = int_lt(i41, 0)
guard_false(i43, descr=<Guard0xffff9b7df3d0>)
jump(p0, p1, p8, i39, p22, i28, descr=TargetToken(281473290477792))
Expected:
i7 = int_lt(i5, i6)
guard_true(i7, descr=...)
guard_not_invalidated(descr=...)
i9 = int_add_ovf(i5, 2)
guard_no_overflow(descr=...)
guard_not_invalidated?
ticker0 = getfield_raw_i(#, descr=<FieldS pypysig_long_struct_inner.c_value .*>)
ticker_cond0 = int_lt(ticker0, 0)
guard_false(ticker_cond0, descr=...)
jump(..., descr=...)
_________________________ TestInstance.test_load_attr __________________________
self = <pypy.module.pypyjit.test_pypy_c.test_instance.TestInstance object at 0x000000002efabfa0>
def test_load_attr(self):
src = '''
class A(object):
pass
a = A()
a.x = 1
def main(n):
i = 0
while i < n:
i = i + a.x
return i
'''
log = self.run(src, [1000])
assert log.result == 1000
loop, = log.loops_by_filename(self.filepath)
> assert loop.match("""
i9 = int_lt(i5, i6)
guard_true(i9, descr=...)
guard_not_invalidated(descr=...)
i10 = int_add(i5, 1)
--TICK--
jump(..., descr=...)
""")
pypy/module/pypyjit/test_pypy_c/test_instance.py:50:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
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 0x000000003164a1a8>
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=<Guard0xffff8b6f4b60>)
i31 = int_lt(i26, i20)
guard_true(i31, descr=<Guard0xffff8b703d30>)
i33 = int_add(i26, 1)
i35 = getfield_raw_i(281473101930184, descr=<FieldS pypysig_long_struct_inner.c_value 0>)
i37 = int_lt(i35, 0)
guard_false(i37, descr=<Guard0xffff8b703d90>)
jump(p0, p1, p8, i33, i20, descr=TargetToken(281473021059680))
Expected:
i9 = int_lt(i5, i6)
guard_true(i9, descr=...)
guard_not_invalidated(descr=...)
i10 = int_add(i5, 1)
guard_not_invalidated?
ticker0 = getfield_raw_i(#, descr=<FieldS pypysig_long_struct_inner.c_value .*>)
ticker_cond0 = int_lt(ticker0, 0)
guard_false(ticker_cond0, descr=...)
jump(..., descr=...)
______________________ TestInstance.test_mutate_class_int ______________________
self = <pypy.module.pypyjit.test_pypy_c.test_instance.TestInstance object at 0x000000002ca90170>
def test_mutate_class_int(self):
def fn(n):
class A(object):
count = 1
def __init__(self, a):
self.a = a
def f(self):
return self.count
i = 0
a = A(1)
while i < n:
A.count += 1 # ID: mutate
i = a.f() # ID: meth1
return i
#
log = self.run(fn, [1000], threshold=10)
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('mutate', opcode='LOAD_ATTR')
assert log.opnames(ops) == ['guard_value',
'guard_not_invalidated',
> 'getfield_gc_i']
E assert ['getfield_gc_i'] == ['guard_value', 'gua...ed', 'getfield_gc_i']
E At index 0 diff: 'getfield_gc_i' != 'guard_value'
E Right contains more items, first extra item: 'guard_not_invalidated'
E Use -v to get the full diff
pypy/module/pypyjit/test_pypy_c/test_instance.py:112: AssertionError
________________________ TestInstance.test_mutate_class ________________________
self = <pypy.module.pypyjit.test_pypy_c.test_instance.TestInstance object at 0x000000003083ce90>
def test_mutate_class(self):
def fn(n):
class LL(object):
def __init__(self, n):
self.n = n
class A(object):
count = None
def __init__(self, a):
self.a = a
def f(self):
return self.count
i = 0
a = A(1)
while i < n:
A.count = LL(A.count) # ID: mutate
a.f() # ID: meth1
i += 1
return i
#
log = self.run(fn, [1000], threshold=10)
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('mutate', opcode='LOAD_ATTR')
assert log.opnames(ops) == ['guard_value',
'guard_not_invalidated',
'getfield_gc_r', 'guard_nonnull_class',
> 'getfield_gc_r', 'guard_value', # type check on the attribute
]
E assert ['getfield_gc...'guard_value'] == ['guard_value'...'guard_value']
E At index 0 diff: 'getfield_gc_r' != 'guard_value'
E Right contains more items, first extra item: 'getfield_gc_r'
E Use -v to get the full diff
pypy/module/pypyjit/test_pypy_c/test_instance.py:162: AssertionError
______________________ TestInstance.test_python_contains _______________________
self = <pypy.module.pypyjit.test_pypy_c.test_instance.TestInstance object at 0x000000002fbd05d0>
def test_python_contains(self):
def main():
class A(object):
def __contains__(self, v):
return True
i = 0
a = A()
while i < 100:
i += i in a # ID: contains
b = 0 # to make sure that JUMP_ABSOLUTE is not part of the ID
log = self.run(main, [], threshold=80)
loop, = log.loops_by_filename(self.filepath)
> assert loop.match_by_id("contains", """
guard_not_invalidated(descr=...)
i11 = force_token()
i12 = int_add(i5, 1)
""")
pypy/module/pypyjit/test_pypy_c/test_instance.py:208:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pypy/module/pypyjit/test_pypy_c/model.py:182: in match_by_id
return matcher.match(expected_src, ignore_ops=ignore_ops)
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 0x000000002c83a7c8>
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 = 'contains'
('operation mismatch',)
<could not determine information>
Ignore ops: []
Got:
===== HERE =====
p52 = force_token()
i57 = int_add(i45, 1)
Expected:
guard_not_invalidated(descr=...)
i11 = force_token()
i12 = int_add(i5, 1)
___________________________ TestInstance.test_super ____________________________
self = <pypy.module.pypyjit.test_pypy_c.test_instance.TestInstance object at 0x000000002da98678>
def test_super(self):
def main():
class A(object):
def m(self, x):
return x + 1
class B(A):
def m(self, x):
return super(B, self).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=...)
i79 = force_token()
i80 = force_token()
i81 = int_add(i72, 1)
--TICK--
jump(..., descr=...)
""")
pypy/module/pypyjit/test_pypy_c/test_instance.py:247:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
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 0x000000002cbeadb0>
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=<Guard0xffffadaf4ba8>)
i52 = int_lt(i44, 300)
guard_true(i52, descr=<Guard0xffffadb17af0>)
p53 = force_token()
p56 = force_token()
i60 = int_add(i44, 1)
i64 = getfield_raw_i(281473676549832, descr=<FieldS pypysig_long_struct_inner.c_value 0>)
i66 = int_lt(i64, 0)
guard_false(i66, descr=<Guard0xffffadb17b50>)
jump(p0, p1, p8, i60, p12, p20, p31, descr=TargetToken(281473595679328))
Expected:
i78 = int_lt(i72, 300)
guard_true(i78, descr=...)
guard_not_invalidated(descr=...)
i79 = force_token()
i80 = force_token()
i81 = int_add(i72, 1)
guard_not_invalidated?
ticker0 = getfield_raw_i(#, descr=<FieldS pypysig_long_struct_inner.c_value .*>)
ticker_cond0 = int_lt(ticker0, 0)
guard_false(ticker_cond0, descr=...)
jump(..., descr=...)
_______________________ TestInstance.test_super_no_args ________________________
self = <pypy.module.pypyjit.test_pypy_c.test_instance.TestInstance object at 0x000000002e288100>
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 0x0000000030241e18>
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=<Guard0xffff81fe2bf0>)
i56 = int_lt(i48, 300)
guard_true(i56, descr=<Guard0xffff820101a0>)
p57 = force_token()
p60 = force_token()
p61 = force_token()
i65 = int_add(i48, 1)
i69 = getfield_raw_i(281472944643784, 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=<Guard0xffff81fe2c38>)
jump(p0, p1, p8, i65, p20, p30, descr=TargetToken(281472862650976))
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=...)
_________________ TestInstance.test_float_instance_field_read __________________
self = <pypy.module.pypyjit.test_pypy_c.test_instance.TestInstance object at 0x0000000031596870>
def test_float_instance_field_read(self):
def main():
class A(object):
def __init__(self, x, y):
self.x = float(x)
self.y = float(y)
l = [A(i, i * 5) for i in range(2000)]
res = 0
for x in l:
res += x.x + x.y # ID: get
return res
log = self.run(main, [])
listcomp, loop, = log.loops_by_filename(self.filepath)
if sys.maxint == 2**63 - 1:
> loop.match_by_id('get', """
p67 = getfield_gc_r(p63, descr=...) # map
guard_value(p67, ConstPtr(ptr68), descr=...) # promote map
guard_not_invalidated(descr=...)
p69 = getfield_gc_r(p63, descr=...) # value0
i71 = getarrayitem_gc_i(p69, 0, descr=...) # x
f71 = convert_longlong_bytes_to_float(i71)
i73 = getarrayitem_gc_i(p69, 1, descr=...) # y
f73 = convert_longlong_bytes_to_float(i73)
f74 = float_add(f71, f73) # add them
f75 = float_add(f57, f74)
--TICK--
""")
pypy/module/pypyjit/test_pypy_c/test_instance.py:307:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pypy/module/pypyjit/test_pypy_c/model.py:182: in match_by_id
return matcher.match(expected_src, ignore_ops=ignore_ops)
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 0x0000000032009e50>
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 = 'get'
('operation mismatch',)
<could not determine information>
Ignore ops: []
Got:
p60 = getfield_gc_r(p56, descr=<FieldP pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable.inst_map 48>)
guard_value(p60, ConstPtr(ptr61), descr=<Guard0xffff96fae8c0>)
===== HERE =====
p62 = getfield_gc_r(p56, descr=<FieldP pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable.inst__value0 8>)
i64 = getarrayitem_gc_i(p62, 0, descr=<ArrayS 8>)
f65 = convert_longlong_bytes_to_float(i64)
i67 = getarrayitem_gc_i(p62, 1, descr=<ArrayS 8>)
f68 = convert_longlong_bytes_to_float(i67)
f69 = float_add(f65, f68)
f70 = float_add(f50, f69)
i72 = getfield_raw_i(281473296965320, descr=<FieldS pypysig_long_struct_inner.c_value 0>)
i74 = int_lt(i72, 0)
guard_false(i74, descr=<Guard0xffff96fae920>)
Expected:
p67 = getfield_gc_r(p63, descr=...) # map
guard_value(p67, ConstPtr(ptr68), descr=...) # promote map
guard_not_invalidated(descr=...)
p69 = getfield_gc_r(p63, descr=...) # value0
i71 = getarrayitem_gc_i(p69, 0, descr=...) # x
f71 = convert_longlong_bytes_to_float(i71)
i73 = getarrayitem_gc_i(p69, 1, descr=...) # y
f73 = convert_longlong_bytes_to_float(i73)
f74 = float_add(f71, f73) # add them
f75 = float_add(f57, f74)
guard_not_invalidated?
ticker0 = getfield_raw_i(#, descr=<FieldS pypysig_long_struct_inner.c_value .*>)
ticker_cond0 = int_lt(ticker0, 0)
guard_false(ticker_cond0, descr=...)
_________________ TestInstance.test_float_instance_field_write _________________
self = <pypy.module.pypyjit.test_pypy_c.test_instance.TestInstance object at 0x0000000031fb5d38>
def test_float_instance_field_write(self):
def main():
class A(object):
def __init__(self, x):
self.x = float(x)
l = [A(i) for i in range(2000)]
for a in l:
a.x += 3.4 # ID: set
log = self.run(main, [])
listcomp, loop, = log.loops_by_filename(self.filepath)
if sys.maxint == 2**63 - 1:
> loop.match_by_id('set', """
p60 = getfield_gc_r(p56, descr=...) # map
guard_value(p60, ConstPtr(ptr61), descr=...)
guard_not_invalidated(descr=...)
p62 = getfield_gc_r(p56, descr=...) # value
i64 = getarrayitem_gc_i(p62, 0, descr=...) # x
f64 = convert_longlong_bytes_to_float(i64)
f66 = float_add(f64, 3.400000)
i66 = convert_float_bytes_to_longlong(f66)
i68 = getfield_raw_i(..., descr=...)
setarrayitem_gc(p62, 0, i66, descr=...) # store x
i71 = int_lt(i68, 0)
guard_false(i71, descr=...)
""")
pypy/module/pypyjit/test_pypy_c/test_instance.py:348:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pypy/module/pypyjit/test_pypy_c/model.py:182: in match_by_id
return matcher.match(expected_src, ignore_ops=ignore_ops)
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 0x00000000321e5a98>
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 = 'set'
('operation mismatch',)
<could not determine information>
Ignore ops: []
Got:
p55 = getfield_gc_r(p51, descr=<FieldP pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable.inst_map 48>)
guard_value(p55, ConstPtr(ptr56), descr=<Guard0xffffa42a7d90>)
===== HERE =====
p57 = getfield_gc_r(p51, descr=<FieldP pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable.inst__value0 8>)
i59 = getarrayitem_gc_i(p57, 0, descr=<ArrayS 8>)
f60 = convert_longlong_bytes_to_float(i59)
f62 = float_add(f60, 3.400000)
i63 = convert_float_bytes_to_longlong(f62)
i65 = getfield_raw_i(281473517166280, descr=<FieldS pypysig_long_struct_inner.c_value 0>)
setarrayitem_gc(p57, 0, i63, descr=<ArrayS 8>)
i68 = int_lt(i65, 0)
guard_false(i68, descr=<Guard0xffffa4282e30>)
Expected:
p60 = getfield_gc_r(p56, descr=...) # map
guard_value(p60, ConstPtr(ptr61), descr=...)
guard_not_invalidated(descr=...)
p62 = getfield_gc_r(p56, descr=...) # value
i64 = getarrayitem_gc_i(p62, 0, descr=...) # x
f64 = convert_longlong_bytes_to_float(i64)
f66 = float_add(f64, 3.400000)
i66 = convert_float_bytes_to_longlong(f66)
i68 = getfield_raw_i(..., descr=...)
setarrayitem_gc(p62, 0, i66, descr=...) # store x
i71 = int_lt(i68, 0)
guard_false(i71, descr=...)
__________________ TestInstance.test_namedtuple_construction ___________________
self = <pypy.module.pypyjit.test_pypy_c.test_instance.TestInstance object at 0x000000003219a870>
def test_namedtuple_construction(self):
def main():
from collections import namedtuple
A = namedtuple("A", "x y")
res = 0
i = 0
while i < 2000:
res += A(i, 0).x
i += 1
log = self.run(main, [])
loop, = log.loops_by_filename(self.filepath)
> assert loop.match("""
i7 = int_lt(i5, 2000)
guard_true(i7, descr=...)
guard_not_invalidated(descr=...)
p1 = force_token()
p2 = force_token()
i20 = int_add_ovf(i19, i5)
guard_no_overflow(descr=...)
i9 = int_add(i5, 1)
--TICK--
jump(..., descr=...)
""")
pypy/module/pypyjit/test_pypy_c/test_instance.py:390:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
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 0x00000000323d8250>
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=<Guard0xffffa0103c88>)
i77 = int_lt(i71, 2000)
guard_true(i77, descr=<Guard0xffffa0067040>)
p78 = force_token()
p81 = new_with_vtable(descr=<SizeDescr 32>)
setfield_gc(p81, ConstPtr(ptr82), descr=<FieldP pypy.objspace.std.unicodeobject.W_UnicodeObject.inst__utf8 24 pure>)
i86 = call_i(ConstClass(ll_call_lookup_function_trampoline__v2118___simple_call__function_), p46, p81, 5338241827623046343, 0, descr=<Calli 8 rrii EF=5 OS=4>)
setfield_gc(p81, ConstPtr(null), descr=<FieldP pypy.objspace.std.unicodeobject.W_UnicodeObject.inst__index_storage 8>)
setfield_gc(p81, 10, descr=<FieldS pypy.objspace.std.unicodeobject.W_UnicodeObject.inst__length 16 pure>)
guard_no_exception(descr=<Guard0xffffa0103bb0>)
i90 = int_lt(i86, 0)
guard_false(i90, descr=<Guard0xffffa0067010>)
p91 = getinteriorfield_gc_r(p57, i86, descr=<InteriorFieldDescr <FieldP odictentry.value 8>>)
guard_value(p91, ConstPtr(ptr92), descr=<Guard0xffffa0103c40>)
p94 = force_token()
i98 = int_add_ovf(i69, i71)
guard_no_overflow(descr=<Guard0xffffa0066fe0>)
i100 = int_add(i71, 1)
i102 = getfield_raw_i(281473450057416, descr=<FieldS pypysig_long_struct_inner.c_value 0>)
i104 = int_lt(i102, 0)
guard_false(i104, descr=<Guard0xffffa0066fb0>)
jump(p0, p1, p8, i98, i100, p33, p46, p34, p57, descr=TargetToken(281473366493408))
Expected:
i7 = int_lt(i5, 2000)
guard_true(i7, descr=...)
guard_not_invalidated(descr=...)
p1 = force_token()
p2 = force_token()
i20 = int_add_ovf(i19, i5)
guard_no_overflow(descr=...)
i9 = int_add(i5, 1)
guard_not_invalidated?
ticker0 = getfield_raw_i(#, descr=<FieldS pypysig_long_struct_inner.c_value .*>)
ticker_cond0 = int_lt(ticker0, 0)
guard_false(ticker_cond0, descr=...)
jump(..., descr=...)
________________________ TestIntbound.test_intbound_gt _________________________
self = <pypy.module.pypyjit.test_pypy_c.test_intbound.TestIntbound object at 0x000000002d9bcf00>
def test_intbound_gt(self):
def main(n):
i, a, b = 0, 0, 0
while i < n:
if i > -1:
a += 1
if i > -2:
b += 1
i += 1
return (a, b)
#
log = self.run(main, [300])
assert log.result == (300, 300)
loop, = log.loops_by_filename(self.filepath)
> assert loop.match("""
i10 = int_lt(i8, i9)
guard_true(i10, descr=...)
i12 = int_add_ovf(i7, 1)
guard_no_overflow(descr=...)
i14 = int_add_ovf(i6, 1)
guard_no_overflow(descr=...)
i17 = int_add(i8, 1)
--TICK--
jump(..., descr=...)
""")
pypy/module/pypyjit/test_pypy_c/test_intbound.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
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 0x000000002d916368>
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=<Guard0xffff87e54bf0>)
i44 = int_lt(i39, i26)
guard_true(i44, descr=<Guard0xffff87e63fa0>)
i46 = int_add_ovf(i33, 1)
guard_no_overflow(descr=<Guard0xffff87e63fd0>)
i48 = int_add_ovf(i37, 1)
guard_no_overflow(descr=<Guard0xffff87e72020>)
i50 = int_add(i39, 1)
i52 = getfield_raw_i(281473043209928, descr=<FieldS pypysig_long_struct_inner.c_value 0>)
i54 = int_lt(i52, 0)
guard_false(i54, descr=<Guard0xffff87e72080>)
jump(p0, p1, p8, i48, i46, i50, p20, i26, descr=TargetToken(281472961684064))
Expected:
i10 = int_lt(i8, i9)
guard_true(i10, descr=...)
i12 = int_add_ovf(i7, 1)
guard_no_overflow(descr=...)
i14 = int_add_ovf(i6, 1)
guard_no_overflow(descr=...)
i17 = int_add(i8, 1)
guard_not_invalidated?
ticker0 = getfield_raw_i(#, descr=<FieldS pypysig_long_struct_inner.c_value .*>)
ticker_cond0 = int_lt(ticker0, 0)
guard_false(ticker_cond0, descr=...)
jump(..., descr=...)
______________________ TestIntbound.test_intbound_sub_lt _______________________
self = <pypy.module.pypyjit.test_pypy_c.test_intbound.TestIntbound object at 0x000000002b3dcc28>
def test_intbound_sub_lt(self):
def main():
i, a = 0, 0
while i < 300:
if i - 10 < 295:
a += 1
i += 1
return a
#
log = self.run(main, [])
assert log.result == 300
loop, = log.loops_by_filename(self.filepath)
> assert loop.match("""
i7 = int_lt(i5, 300)
guard_true(i7, descr=...)
i9 = int_sub_ovf(i5, 10)
guard_no_overflow(descr=...)
i11 = int_add_ovf(i4, 1)
guard_no_overflow(descr=...)
i13 = int_add(i5, 1)
--TICK--
jump(..., descr=...)
""")
pypy/module/pypyjit/test_pypy_c/test_intbound.py:115:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
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 0x000000002b89e368>
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=<Guard0xffff87ba0b60>)
i34 = int_lt(i28, 300)
guard_true(i34, descr=<Guard0xffff87bafcd0>)
i36 = int_sub_ovf(i28, 10)
guard_no_overflow(descr=<Guard0xffff87bafd00>)
i38 = int_add_ovf(i26, 1)
guard_no_overflow(descr=<Guard0xffff87bafd30>)
i40 = int_add(i28, 1)
i42 = getfield_raw_i(281473041112776, descr=<FieldS pypysig_long_struct_inner.c_value 0>)
i44 = int_lt(i42, 0)
guard_false(i44, descr=<Guard0xffff87bafd90>)
jump(p0, p1, i38, i40, descr=TargetToken(281472958849632))
Expected:
i7 = int_lt(i5, 300)
guard_true(i7, descr=...)
i9 = int_sub_ovf(i5, 10)
guard_no_overflow(descr=...)
i11 = int_add_ovf(i4, 1)
guard_no_overflow(descr=...)
i13 = int_add(i5, 1)
guard_not_invalidated?
ticker0 = getfield_raw_i(#, descr=<FieldS pypysig_long_struct_inner.c_value .*>)
ticker_cond0 = int_lt(ticker0, 0)
guard_false(ticker_cond0, descr=...)
jump(..., descr=...)
_____________________ TestIntbound.test_intbound_addsub_ge _____________________
self = <pypy.module.pypyjit.test_pypy_c.test_intbound.TestIntbound object at 0x000000002ea0bec0>
def test_intbound_addsub_ge(self):
def main(n):
i, a, b = 0, 0, 0
while i < n:
if i + 5 >= 5:
a += 1
if i - 1 >= -1:
b += 1
i += 1
return (a, b)
#
log = self.run(main, [300])
assert log.result == (300, 300)
loop, = log.loops_by_filename(self.filepath)
> assert loop.match("""
i10 = int_lt(i8, i9)
guard_true(i10, descr=...)
i12 = int_add_ovf(i8, 5)
guard_no_overflow(descr=...)
i14 = int_add_ovf(i7, 1)
guard_no_overflow(descr=...)
i16s = int_add(i8, -1)
i16 = int_add_ovf(i6, 1)
guard_no_overflow(descr=...)
i19 = int_add(i8, 1)
--TICK--
jump(..., descr=...)
""")
pypy/module/pypyjit/test_pypy_c/test_intbound.py:141:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
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 0x000000002cfb0058>
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=<Guard0xffffadf5ebf0>)
i48 = int_lt(i43, i26)
guard_true(i48, descr=<Guard0xffffadf6dfd0>)
i50 = int_add_ovf(i43, 5)
guard_no_overflow(descr=<Guard0xffffadf7e020>)
i52 = int_add_ovf(i35, 1)
guard_no_overflow(descr=<Guard0xffffadf7e050>)
i54 = int_add(i43, -1)
i56 = int_add_ovf(i41, 1)
guard_no_overflow(descr=<Guard0xffffadf7e080>)
i58 = int_add(i43, 1)
i60 = getfield_raw_i(281473682841288, descr=<FieldS pypysig_long_struct_inner.c_value 0>)
i62 = int_lt(i60, 0)
guard_false(i62, descr=<Guard0xffffadf7e0e0>)
jump(p0, p1, p8, i56, i52, i58, p20, i26, descr=TargetToken(281473600307808))
Expected:
i10 = int_lt(i8, i9)
guard_true(i10, descr=...)
i12 = int_add_ovf(i8, 5)
guard_no_overflow(descr=...)
i14 = int_add_ovf(i7, 1)
guard_no_overflow(descr=...)
i16s = int_add(i8, -1)
i16 = int_add_ovf(i6, 1)
guard_no_overflow(descr=...)
i19 = int_add(i8, 1)
guard_not_invalidated?
ticker0 = getfield_raw_i(#, descr=<FieldS pypysig_long_struct_inner.c_value .*>)
ticker_cond0 = int_lt(ticker0, 0)
guard_false(ticker_cond0, descr=...)
jump(..., descr=...)
_____________________ TestIntbound.test_intbound_addmul_ge _____________________
self = <pypy.module.pypyjit.test_pypy_c.test_intbound.TestIntbound object at 0x000000002d492870>
def test_intbound_addmul_ge(self):
def main(n):
i, a, b = 0, 0, 0
while i < 300:
if i + 5 >= 5:
a += 1
if 2 * i >= 0:
b += 1
i += 1
return (a, b)
#
log = self.run(main, [300])
assert log.result == (300, 300)
loop, = log.loops_by_filename(self.filepath)
> assert loop.match("""
i10 = int_lt(i8, 300)
guard_true(i10, descr=...)
i12 = int_add(i8, 5)
i14 = int_add_ovf(i7, 1)
guard_no_overflow(descr=...)
i16 = int_lshift(i8, 1)
i18 = int_add_ovf(i6, 1)
guard_no_overflow(descr=...)
i21 = int_add(i8, 1)
--TICK--
jump(..., descr=...)
""")
pypy/module/pypyjit/test_pypy_c/test_intbound.py:170:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
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 0x000000002ce432f0>
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=<Guard0xffff9d0b2ba8>)
i48 = int_lt(i42, 300)
guard_true(i48, descr=<Guard0xffff9d0c1f40>)
i50 = int_add(i42, 5)
i52 = int_add_ovf(i34, 1)
guard_no_overflow(descr=<Guard0xffff9d0c1f70>)
i54 = int_lshift(i42, 1)
i56 = int_add_ovf(i40, 1)
guard_no_overflow(descr=<Guard0xffff9d0c1fa0>)
i58 = int_add(i42, 1)
i60 = getfield_raw_i(281473397628616, descr=<FieldS pypysig_long_struct_inner.c_value 0>)
i62 = int_lt(i60, 0)
guard_false(i62, descr=<Guard0xffff9d0d2020>)
jump(p0, p1, p8, i56, i52, i58, p20, descr=TargetToken(281473316487776))
Expected:
i10 = int_lt(i8, 300)
guard_true(i10, descr=...)
i12 = int_add(i8, 5)
i14 = int_add_ovf(i7, 1)
guard_no_overflow(descr=...)
i16 = int_lshift(i8, 1)
i18 = int_add_ovf(i6, 1)
guard_no_overflow(descr=...)
i21 = int_add(i8, 1)
guard_not_invalidated?
ticker0 = getfield_raw_i(#, descr=<FieldS pypysig_long_struct_inner.c_value .*>)
ticker_cond0 = int_lt(ticker0, 0)
guard_false(ticker_cond0, descr=...)
jump(..., descr=...)
________________________ TestIntbound.test_intbound_eq _________________________
self = <pypy.module.pypyjit.test_pypy_c.test_intbound.TestIntbound object at 0x000000003071f830>
def test_intbound_eq(self):
def main(a, n):
i, s = 0, 0
while i < 300:
if a == 7:
s += a + 1
elif i == 10:
s += i
else:
s += 1
i += 1
return s
#
log = self.run(main, [7, 300])
assert log.result == main(7, 300)
log = self.run(main, [10, 300])
assert log.result == main(10, 300)
log = self.run(main, [42, 300])
assert log.result == main(42, 300)
loop, = log.loops_by_filename(self.filepath)
> assert loop.match("""
i10 = int_lt(i8, 300)
guard_true(i10, descr=...)
i12 = int_eq(i8, 10)
guard_false(i12, descr=...)
i14 = int_add_ovf(i7, 1)
guard_no_overflow(descr=...)
i16 = int_add(i8, 1)
--TICK--
jump(..., descr=...)
""")
pypy/module/pypyjit/test_pypy_c/test_intbound.py:204:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
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 0x000000002d940a68>
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=<Guard0xffff9f34aba8>)
i44 = int_lt(i38, 300)
guard_true(i44, descr=<Guard0xffff9f359f40>)
i46 = int_eq(i38, 10)
guard_false(i46, descr=<Guard0xffff9f359fa0>)
i48 = int_add_ovf(i36, 1)
guard_no_overflow(descr=<Guard0xffff9f359fd0>)
i50 = int_add(i38, 1)
i52 = getfield_raw_i(281473435377352, descr=<FieldS pypysig_long_struct_inner.c_value 0>)
i54 = int_lt(i52, 0)
guard_false(i54, descr=<Guard0xffff9f36c050>)
jump(p0, p1, p8, p10, i48, i50, p20, descr=TargetToken(281473352761952))
Expected:
i10 = int_lt(i8, 300)
guard_true(i10, descr=...)
i12 = int_eq(i8, 10)
guard_false(i12, descr=...)
i14 = int_add_ovf(i7, 1)
guard_no_overflow(descr=...)
i16 = int_add(i8, 1)
guard_not_invalidated?
ticker0 = getfield_raw_i(#, descr=<FieldS pypysig_long_struct_inner.c_value .*>)
ticker_cond0 = int_lt(ticker0, 0)
guard_false(ticker_cond0, descr=...)
jump(..., descr=...)
________________________ TestIntbound.test_intbound_mul ________________________
self = <pypy.module.pypyjit.test_pypy_c.test_intbound.TestIntbound object at 0x00000000303d4d08>
def test_intbound_mul(self):
def main(a):
i, s = 0, 0
while i < 300:
assert i >= 0
if 2 * i < 30000:
s += 1
else:
s += a
i += 1
return s
#
log = self.run(main, [7])
assert log.result == 300
loop, = log.loops_by_filename(self.filepath)
> assert loop.match("""
i8 = int_lt(i6, 300)
guard_true(i8, descr=...)
guard_not_invalidated?
i10 = int_lshift(i6, 1)
i12 = int_add_ovf(i5, 1)
guard_no_overflow(descr=...)
i14 = int_add(i6, 1)
--TICK--
jump(..., descr=...)
""")
pypy/module/pypyjit/test_pypy_c/test_intbound.py:231:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
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 0x000000002fbd0b80>
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=<Guard0xffffb0f28b60>)
i38 = int_lt(i32, 300)
guard_true(i38, descr=<Guard0xffffb0f37e50>)
i40 = int_lshift(i32, 1)
i42 = int_add_ovf(i30, 1)
guard_no_overflow(descr=<Guard0xffffb0f37e80>)
i44 = int_add(i32, 1)
i46 = getfield_raw_i(281473733172936, descr=<FieldS pypysig_long_struct_inner.c_value 0>)
i48 = int_lt(i46, 0)
guard_false(i48, descr=<Guard0xffffb0f37ee0>)
jump(p0, p1, p8, i42, i44, descr=TargetToken(281473650418272))
Expected:
i8 = int_lt(i6, 300)
guard_true(i8, descr=...)
guard_not_invalidated?
i10 = int_lshift(i6, 1)
i12 = int_add_ovf(i5, 1)
guard_no_overflow(descr=...)
i14 = int_add(i6, 1)
guard_not_invalidated?
ticker0 = getfield_raw_i(#, descr=<FieldS pypysig_long_struct_inner.c_value .*>)
ticker_cond0 = int_lt(ticker0, 0)
guard_false(ticker_cond0, descr=...)
jump(..., descr=...)
___________________________ TestIntbound.test_assert ___________________________
self = <pypy.module.pypyjit.test_pypy_c.test_intbound.TestIntbound object at 0x00000000321c9e18>
def test_assert(self):
def main(a):
i, s = 0, 0
while i < 300:
assert a == 7
s += a + 1
i += 1
return s
log = self.run(main, [7])
assert log.result == 300*8
loop, = log.loops_by_filename(self.filepath)
> assert loop.match("""
i8 = int_lt(i6, 300)
guard_true(i8, descr=...)
guard_not_invalidated?
i10 = int_add_ovf(i5, 8)
guard_no_overflow(descr=...)
i12 = int_add(i6, 1)
--TICK--
jump(..., descr=...)
""")
pypy/module/pypyjit/test_pypy_c/test_intbound.py:254:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
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 0x0000000028d624b8>
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=<Guard0xffff87d7eba8>)
i40 = int_lt(i34, 300)
guard_true(i40, descr=<Guard0xffff87d8ddf0>)
i42 = int_add_ovf(i32, 8)
guard_no_overflow(descr=<Guard0xffff87d8de20>)
i44 = int_add(i34, 1)
i46 = getfield_raw_i(281473043209928, descr=<FieldS pypysig_long_struct_inner.c_value 0>)
i48 = int_lt(i46, 0)
guard_false(i48, descr=<Guard0xffff87d8de80>)
jump(p0, p1, p8, i42, i44, descr=TargetToken(281472960807520))
Expected:
i8 = int_lt(i6, 300)
guard_true(i8, descr=...)
guard_not_invalidated?
i10 = int_add_ovf(i5, 8)
guard_no_overflow(descr=...)
i12 = int_add(i6, 1)
guard_not_invalidated?
ticker0 = getfield_raw_i(#, descr=<FieldS pypysig_long_struct_inner.c_value .*>)
ticker_cond0 = int_lt(ticker0, 0)
guard_false(ticker_cond0, descr=...)
jump(..., descr=...)
______________________ TestIntbound.test_abs_branch_free _______________________
self = <pypy.module.pypyjit.test_pypy_c.test_intbound.TestIntbound object at 0x000000002f30ebf0>
def test_abs_branch_free(self):
import sys
def main(start, stop):
res = 0
for i in range(start, stop):
res += abs(i) # ID: abs
return res
log = self.run(main, [-10000, 10000])
loop, = log.loops_by_filename(self.filepath)
assert loop.match_by_id('abs', """
setfield_gc(p18, i60, descr=...)
guard_not_invalidated(descr=...)
i63 = int_eq(i58, ...) # check whether it's MININT
guard_false(i63, descr=...)
i65 = int_rshift(i58, %s)
i66 = int_xor(i58, i65)
i67 = int_sub(i66, i65)
i68 = int_add_ovf(i51, i67)
guard_no_overflow(descr=...)
--TICK--
> """ % sys.maxsize.bit_length())
pypy/module/pypyjit/test_pypy_c/test_intbound.py:322:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pypy/module/pypyjit/test_pypy_c/model.py:182: in match_by_id
return matcher.match(expected_src, ignore_ops=ignore_ops)
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 0x000000002d8f9c58>
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 = 'abs'
('operation mismatch',)
<could not determine information>
Ignore ops: []
Got:
setfield_gc(p16, i47, descr=<FieldS pypy.module.__builtin__.functional.W_IntRangeIterator.inst_current 8>)
===== HERE =====
i49 = int_eq(i44, -9223372036854775808)
guard_false(i49, descr=<Guard0xffffa8df2b60>)
i52 = int_rshift(i44, 63)
i53 = int_xor(i44, i52)
i54 = int_sub(i53, i52)
i55 = int_add_ovf(i39, i54)
guard_no_overflow(descr=<Guard0xffffa8e01e50>)
i57 = getfield_raw_i(281473596858056, descr=<FieldS pypysig_long_struct_inner.c_value 0>)
i59 = int_lt(i57, 0)
guard_false(i59, descr=<Guard0xffffa8e01eb0>)
Expected:
setfield_gc(p18, i60, descr=...)
guard_not_invalidated(descr=...)
i63 = int_eq(i58, ...) # check whether it's MININT
guard_false(i63, descr=...)
i65 = int_rshift(i58, 63)
i66 = int_xor(i58, i65)
i67 = int_sub(i66, i65)
i68 = int_add_ovf(i51, i67)
guard_no_overflow(descr=...)
guard_not_invalidated?
ticker0 = getfield_raw_i(#, descr=<FieldS pypysig_long_struct_inner.c_value .*>)
ticker_cond0 = int_lt(ticker0, 0)
guard_false(ticker_cond0, descr=...)
______________________________ TestLogParser.test ______________________________
self = <pypy.module.pypyjit.test_pypy_c.test_jitlogparser.TestLogParser object at 0x000000002e62cb48>
def test(self):
def fn_with_bridges(N):
def is_prime(x):
for y in range(2, x):
if x % y == 0:
return False
return True
result = 0
for x in range(N):
if x % 3 == 0:
result += 5
elif x % 5 == 0:
result += 3
elif is_prime(x):
result += x
elif x == 99:
result *= 2
return result
#
N = 10000
_log = self.run(fn_with_bridges, [N])
log, loops = import_log(_log.logfile)
parse_log_counts(extract_category(log, 'jit-backend-count'), loops)
is_prime_loops = []
fn_with_bridges_loops = []
bridges = {}
for loop in loops:
if hasattr(loop, 'force_asm'):
try:
> loop.force_asm()
pypy/module/pypyjit/test_pypy_c/test_jitlogparser.py:45:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
rpython/tool/jitlogparser/parser.py:472: in <lambda>
dump_start=start_ofs))
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.tool.jitlogparser.parser.SimpleParser object at 0x000000002cee6bb8>
loop = <rpython.jit.tool.oparser_model.ExtendedTreeLoop object at 0x000000002dd26800>
backend_dump = '000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...07b3f2f0ffdff21000e0f200023fd6d0dfff58b00b00f910a29cd21007b3f2f0ffdff2b01300f910009ad21007b3f2f0ffdff21000e0f200023fd6'
backend_tp = 'arm', dump_start = 281473235608864L
def postprocess(self, loop, backend_dump=None, backend_tp=None,
dump_start=0):
if backend_dump is not None:
raw_asm = self._asm_disassemble(backend_dump.decode('hex'),
backend_tp, dump_start)
# additional mess: if the backend_dump starts with a series
# of zeros, raw_asm's first regular line is *after* that,
# after a line saying "...". So we assume that start==dump_start
# if this parameter was passed.
asm = []
start = dump_start
for elem in raw_asm:
if len(elem.split("\t")) < 3:
continue
e = elem.split("\t")
adr = e[0]
v = elem # --- more compactly: " ".join(e[2:])
if not start: # only if 'dump_start' is left at 0
start = int(adr.strip(":"), 16)
ofs = int(adr.strip(":"), 16) - start
if ofs >= 0:
asm.append((ofs, v.strip("\n")))
asm_index = 0
for i, op in enumerate(loop.operations):
end = 0
j = i + 1
while end == 0:
if j == len(loop.operations):
end = loop.last_offset
break
if loop.operations[j].offset is None:
j += 1
else:
end = loop.operations[j].offset
if op.offset is not None:
> while asm[asm_index][0] < op.offset:
E IndexError: list index out of range
rpython/tool/jitlogparser/parser.py:141: IndexError
----------------------------- Captured stdout call -----------------------------
loading symbols from /buildbot/slave/pypy-c-jit-linux-aarch64/build/pypy/goal/pypy3.12-c...
23 symbols found
----------------------------- Captured stderr call -----------------------------
0%..loaded
______________________________ TestMath.test_log _______________________________
self = <pypy.module.pypyjit.test_pypy_c.test_math.TestMath object at 0x000000002fdbd248>
def test_log(self):
def main(n):
import math
i = 1
s = 0.0
while i < n:
s += math.log(i) - math.log10(i)
i += 1
return s
log = self.run(main, [500])
assert round(log.result, 6) == round(main(500), 6)
loop, = log.loops_by_filename(self.filepath)
> assert loop.match("""
i2 = int_lt(i0, i1)
guard_true(i2, descr=...)
guard_not_invalidated(descr=...)
f1 = cast_int_to_float(i0)
i3 = float_le(f1, 0.0)
guard_false(i3, descr=...)
f2 = call_f(ConstClass(log), f1, descr=<Callf . f EF=2>)
f3 = call_f(ConstClass(log10), f1, descr=<Callf . f EF=2>)
f4 = float_sub(f2, f3)
f5 = float_add(f0, f4)
i4 = int_add(i0, 1)
--TICK--
jump(..., descr=...)
""")
pypy/module/pypyjit/test_pypy_c/test_math.py:19:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
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 0x000000002d2edc90>
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=<Guard0xffffb9c60cc8>)
i55 = int_lt(i50, i30)
guard_true(i55, descr=<Guard0xffffb9c7e950>)
f56 = cast_int_to_float(i50)
i58 = float_le(f56, 0.000000)
guard_false(i58, descr=<Guard0xffffb9c7e9b0>)
f60 = call_f(ConstClass(log), f56, descr=<Callf 8 f EF=2>)
f62 = call_f(ConstClass(log10), f56, descr=<Callf 8 f EF=2>)
f63 = float_sub(f60, f62)
f64 = float_add(f48, f63)
i66 = int_add(i50, 1)
i68 = getfield_raw_i(281473879973576, descr=<FieldS pypysig_long_struct_inner.c_value 0>)
i70 = int_lt(i68, 0)
guard_false(i70, descr=<Guard0xffffb9c60d10>)
jump(p0, p1, p8, p10, i66, f64, i30, descr=TargetToken(281473798496864))
Expected:
i2 = int_lt(i0, i1)
guard_true(i2, descr=...)
guard_not_invalidated(descr=...)
f1 = cast_int_to_float(i0)
i3 = float_le(f1, 0.0)
guard_false(i3, descr=...)
f2 = call_f(ConstClass(log), f1, descr=<Callf . f EF=2>)
f3 = call_f(ConstClass(log10), f1, descr=<Callf . f EF=2>)
f4 = float_sub(f2, f3)
f5 = float_add(f0, f4)
i4 = int_add(i0, 1)
guard_not_invalidated?
ticker0 = getfield_raw_i(#, descr=<FieldS pypysig_long_struct_inner.c_value .*>)
ticker_cond0 = int_lt(ticker0, 0)
guard_false(ticker_cond0, descr=...)
jump(..., descr=...)
____________________________ TestMath.test_sin_cos _____________________________
self = <pypy.module.pypyjit.test_pypy_c.test_math.TestMath object at 0x000000002f3e5a60>
def test_sin_cos(self):
def main(n):
import math
i = 1
s = 0.0
while i < n:
s += math.sin(i) - math.cos(i)
i += 1
return s
log = self.run(main, [500])
assert round(log.result, 6) == round(main(500), 6)
loop, = log.loops_by_filename(self.filepath)
> assert loop.match("""
i2 = int_lt(i0, i1)
guard_true(i2, descr=...)
guard_not_invalidated(descr=...)
f1 = cast_int_to_float(i0)
i6 = --ISINF--(f1)
guard_false(i6, descr=...)
f2 = call_f(ConstClass(sin), f1, descr=<Callf . f EF=0>)
f3 = call_f(ConstClass(cos), f1, descr=<Callf . f EF=0>)
f4 = float_sub(f2, f3)
f5 = float_add(f0, f4)
i7 = int_add(i0, 1)
--TICK--
jump(..., descr=)
""")
pypy/module/pypyjit/test_pypy_c/test_math.py:48:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
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 0x000000002dcb52b8>
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=<Guard0xffffabd4acc8>)
i56 = int_lt(i51, i30)
guard_true(i56, descr=<Guard0xffffabd68440>)
f57 = cast_int_to_float(i51)
f59 = float_add(f57, 11235582092889474423308157442431404585112356118389416079589380072358292237843810195794279832650471001320007117491962084853674360550901038905802964414967132773610493339054092829768888725077880882465817684505312860552384417646403930092119569408801702322709406917786643639996702871154982269052209770601514008576.000000)
i60 = float_eq(f59, f57)
guard_false(i60, descr=<Guard0xffffabd684a0>)
f62 = call_f(ConstClass(sin), f57, descr=<Callf 8 f EF=0>)
f64 = call_f(ConstClass(cos), f57, descr=<Callf 8 f EF=0>)
f65 = float_sub(f62, f64)
f66 = float_add(f49, f65)
i68 = int_add(i51, 1)
i70 = getfield_raw_i(281473647189704, descr=<FieldS pypysig_long_struct_inner.c_value 0>)
i72 = int_lt(i70, 0)
guard_false(i72, descr=<Guard0xffffabd4ad10>)
jump(p0, p1, p8, p10, i68, f66, i30, descr=TargetToken(281473564574304))
Expected:
i2 = int_lt(i0, i1)
guard_true(i2, descr=...)
guard_not_invalidated(descr=...)
f1 = cast_int_to_float(i0)
f1\B999 = float_add(f1, ...)
i6 = float_eq(f1\B999, f1)
guard_false(i6, descr=...)
f2 = call_f(ConstClass(sin), f1, descr=<Callf . f EF=0>)
f3 = call_f(ConstClass(cos), f1, descr=<Callf . f EF=0>)
f4 = float_sub(f2, f3)
f5 = float_add(f0, f4)
i7 = int_add(i0, 1)
guard_not_invalidated?
ticker0 = getfield_raw_i(#, descr=<FieldS pypysig_long_struct_inner.c_value .*>)
ticker_cond0 = int_lt(ticker0, 0)
guard_false(ticker_cond0, descr=...)
jump(..., descr=)
____________________________ TestMath.test_pow_two _____________________________
self = <pypy.module.pypyjit.test_pypy_c.test_math.TestMath object at 0x0000000030854ec8>
def test_pow_two(self):
def main(n):
s = 0.123
while n > 0:
s -= s ** 2 # ID: pow
n -= 1
return s
log = self.run(main, [500])
assert abs(log.result - main(500)) < 1e-9
loop, = log.loops_by_filename(self.filepath)
> assert loop.match_by_id("pow", """
guard_not_invalidated(descr=...)
f38 = float_mul(f30, f30)
f39 = float_sub(f30, f38)
""")
pypy/module/pypyjit/test_pypy_c/test_math.py:104:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pypy/module/pypyjit/test_pypy_c/model.py:182: in match_by_id
return matcher.match(expected_src, ignore_ops=ignore_ops)
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 0x000000002ba04a30>
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 = 'pow'
('operation mismatch',)
<could not determine information>
Ignore ops: []
Got:
===== HERE =====
f35 = float_mul(f26, f26)
f36 = float_sub(f26, f35)
Expected:
guard_not_invalidated(descr=...)
f38 = float_mul(f30, f30)
f39 = float_sub(f30, f38)
___________________________ TestMinMax.test_min_max ____________________________
self = <pypy.module.pypyjit.test_pypy_c.test_min_max.TestMinMax object at 0x000000002f6d3d70>
def test_min_max(self):
def main():
i=0
sa=0
while i < 300:
sa+=min(max(i, 3000), 4000)
i+=1
return sa
log = self.run(main, [])
assert log.result == 300*3000
loop, = log.loops_by_filename(self.filepath)
> assert loop.match("""
i7 = int_lt(i4, 300)
guard_true(i7, descr=...)
guard_not_invalidated(descr=...)
i9 = int_add_ovf(i5, 3000)
guard_no_overflow(descr=...)
i11 = int_add(i4, 1)
--TICK--
jump(..., descr=...)
""")
pypy/module/pypyjit/test_pypy_c/test_min_max.py:16:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
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 0x000000002cc441e0>
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=<Guard0xffffb0f28b60>)
i38 = int_lt(i32, 300)
guard_true(i38, descr=<Guard0xffffb0f37fd0>)
i40 = int_add_ovf(i30, 3000)
guard_no_overflow(descr=<Guard0xffffb0f48020>)
i42 = int_add(i32, 1)
i44 = getfield_raw_i(281473733172936, descr=<FieldS pypysig_long_struct_inner.c_value 0>)
i46 = int_lt(i44, 0)
guard_false(i46, descr=<Guard0xffffb0f48080>)
jump(p0, p1, i42, i40, descr=TargetToken(281473650418272))
Expected:
i7 = int_lt(i4, 300)
guard_true(i7, descr=...)
guard_not_invalidated(descr=...)
i9 = int_add_ovf(i5, 3000)
guard_no_overflow(descr=...)
i11 = int_add(i4, 1)
guard_not_invalidated?
ticker0 = getfield_raw_i(#, descr=<FieldS pypysig_long_struct_inner.c_value .*>)
ticker_cond0 = int_lt(ticker0, 0)
guard_false(ticker_cond0, descr=...)
jump(..., descr=...)
_______________________________ TestMisc.test_f1 _______________________________
self = <pypy.module.pypyjit.test_pypy_c.test_misc.TestMisc object at 0x000000002d5efa98>
def test_f1(self):
def f1(n):
"Arbitrary test function."
i = 0
x = 1
while i<n:
j = 0
while j<=i:
j = j + 1
x = x + (i&j)
i = i + 1
return x
log = self.run(f1, [2117])
assert log.result == 1083876708
# we get two loops: in the initial one "i" is only read and thus is
# not virtual, then "i" is written and thus we get a new loop where
# "i" is virtual. However, in this specific case the two loops happen
# to contain the very same operations
loop0, loop1 = log.loops_by_filename(self.filepath)
expected = """
i9 = int_le(i7, i8)
guard_true(i9, descr=...)
i11 = int_add_ovf(i7, 1)
guard_no_overflow(descr=...)
i12 = int_and(i8, i11)
i13 = int_add_ovf(i6, i12)
guard_no_overflow(descr=...)
--TICK--
jump(..., descr=...)
"""
> assert loop0.match(expected)
pypy/module/pypyjit/test_pypy_c/test_misc.py:36:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
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 0x000000002d01e6b0>
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=<Guard0xffffb01f2ba8>)
i38 = int_le(i29, i26)
guard_true(i38, descr=<Guard0xffffb0201d90>)
i40 = int_add_ovf(i29, 1)
guard_no_overflow(descr=<Guard0xffffb0201dc0>)
i41 = int_and(i26, i40)
i42 = int_add_ovf(i33, i41)
guard_no_overflow(descr=<Guard0xffffb0201df0>)
i44 = getfield_raw_i(281473718492872, descr=<FieldS pypysig_long_struct_inner.c_value 0>)
i46 = int_lt(i44, 0)
guard_false(i46, descr=<Guard0xffffb0201e50>)
jump(p0, p1, p8, p10, i42, i40, i26, descr=TargetToken(281473636565600))
Expected:
i9 = int_le(i7, i8)
guard_true(i9, descr=...)
i11 = int_add_ovf(i7, 1)
guard_no_overflow(descr=...)
i12 = int_and(i8, i11)
i13 = int_add_ovf(i6, i12)
guard_no_overflow(descr=...)
guard_not_invalidated?
ticker0 = getfield_raw_i(#, descr=<FieldS pypysig_long_struct_inner.c_value .*>)
ticker_cond0 = int_lt(ticker0, 0)
guard_false(ticker_cond0, descr=...)
jump(..., descr=...)
___________________________ TestMisc.test_factorial ____________________________
self = <pypy.module.pypyjit.test_pypy_c.test_misc.TestMisc object at 0x000000002f8a9910>
def test_factorial(self):
def fact(n):
r = 1
while n > 1:
r *= n
n -= 1
return r
log = self.run(fact, [7], threshold=4)
assert log.result == 5040
loop, = log.loops_by_filename(self.filepath)
> assert loop.match("""
i7 = int_gt(i4, 1)
guard_true(i7, descr=...)
i8 = int_mul_ovf(i5, i4)
guard_no_overflow(descr=...)
i10 = int_add(i4, -1)
--TICK--
jump(..., descr=...)
""")
pypy/module/pypyjit/test_pypy_c/test_misc.py:52:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
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 0x000000002eb5a790>
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=<Guard0x1256f220>)
i31 = int_gt(i25, 1)
guard_true(i31, descr=<Guard0x12591970>)
i32 = int_mul_ovf(i23, i25)
guard_no_overflow(descr=<Guard0x125919a0>)
i34 = int_add(i25, -1)
i36 = getfield_raw_i(281473850613448, descr=<FieldS pypysig_long_struct_inner.c_value 0>)
i38 = int_lt(i36, 0)
guard_false(i38, descr=<Guard0x12591a00>)
jump(p0, p1, i34, i32, descr=TargetToken(307637408))
Expected:
i7 = int_gt(i4, 1)
guard_true(i7, descr=...)
i8 = int_mul_ovf(i5, i4)
guard_no_overflow(descr=...)
i10 = int_add(i4, -1)
guard_not_invalidated?
ticker0 = getfield_raw_i(#, descr=<FieldS pypysig_long_struct_inner.c_value .*>)
ticker_cond0 = int_lt(ticker0, 0)
guard_false(ticker_cond0, descr=...)
jump(..., descr=...)
________________________ TestMisc.test_mixed_type_loop _________________________
self = <pypy.module.pypyjit.test_pypy_c.test_misc.TestMisc object at 0x000000002c6bfad0>
def test_mixed_type_loop(self):
def main(n):
i = 0.0
j = 2
while i < n:
i = j + i
return i
#
log = self.run(main, [1000])
assert log.result == 1000.0
loop, = log.loops_by_filename(self.filepath)
> assert loop.match("""
i9 = float_lt(f5, f7)
guard_true(i9, descr=...)
f10 = float_add(f8, f5)
--TICK--
jump(..., descr=...)
""")
pypy/module/pypyjit/test_pypy_c/test_misc.py:86:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
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 0x000000002ce1d398>
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=<Guard0xffff7bfa0ba8>)
i39 = float_lt(f34, f29)
guard_true(i39, descr=<Guard0xffff7bfaff10>)
f40 = float_add(f33, f34)
i42 = getfield_raw_i(281472843980488, descr=<FieldS pypysig_long_struct_inner.c_value 0>)
i44 = int_lt(i42, 0)
guard_false(i44, descr=<Guard0xffff7bfaff70>)
jump(p0, p1, p8, f40, p12, f29, f33, descr=TargetToken(281472761717344))
Expected:
i9 = float_lt(f5, f7)
guard_true(i9, descr=...)
f10 = float_add(f8, f5)
guard_not_invalidated?
ticker0 = getfield_raw_i(#, descr=<FieldS pypysig_long_struct_inner.c_value .*>)
ticker_cond0 = int_lt(ticker0, 0)
guard_false(ticker_cond0, descr=...)
jump(..., descr=...)
________________ TestMisc.test_cached_pure_func_of_equal_fields ________________
self = <pypy.module.pypyjit.test_pypy_c.test_misc.TestMisc object at 0x0000000029797130>
def test_cached_pure_func_of_equal_fields(self):
def main(n):
class A(object):
def __init__(self, val):
self.val1 = self.val2 = val
A("x") # prevent field unboxing
a = A(1)
b = A(1)
sa = 0
while n:
sa += 2*a.val1
sa += 2*b.val2
b.val2 = a.val1
n -= 1
return sa
#
log = self.run(main, [1000])
assert log.result == 4000
loop, = log.loops_by_filename(self.filepath)
> assert loop.match("""
i12 = int_is_true(i4)
guard_true(i12, descr=...)
guard_not_invalidated(descr=...)
guard_nonnull_class(p10, ConstClass(W_IntObject), descr=...)
i10p = getfield_gc_i(p10, descr=...)
i10 = int_mul_ovf(2, i10p)
guard_no_overflow(descr=...)
i14 = int_add_ovf(i13, i10)
guard_no_overflow(descr=...)
i13 = int_add_ovf(i14, i9)
guard_no_overflow(descr=...)
setfield_gc(p17, p10, descr=...)
i17 = int_sub_ovf(i4, 1)
guard_no_overflow(descr=...)
--TICK--
jump(..., descr=...)
""")
pypy/module/pypyjit/test_pypy_c/test_misc.py:113:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
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 0x000000002d117018>
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=<Guard0xffffb0a82cc8>)
i57 = int_is_true(i51)
guard_true(i57, descr=<Guard0xffffb0aa61d0>)
guard_nonnull_class(p56, ConstClass(W_IntObject), descr=<Guard0xffffb0a82d10>)
i59 = getfield_gc_i(p56, descr=<FieldS pypy.objspace.std.intobject.W_IntObject.inst_intval 8 pure>)
i61 = int_mul_ovf(2, i59)
guard_no_overflow(descr=<Guard0xffffb0aa6200>)
i62 = int_add_ovf(i49, i61)
guard_no_overflow(descr=<Guard0xffffb0aa6230>)
i63 = int_add_ovf(i62, i38)
guard_no_overflow(descr=<Guard0xffffb0aa6260>)
setfield_gc(p14, p56, descr=<FieldP pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable.inst__value1 16>)
i65 = int_sub_ovf(i51, 1)
guard_no_overflow(descr=<Guard0xffffb0a82d58>)
i68 = getfield_raw_i(281473726881480, descr=<FieldS pypysig_long_struct_inner.c_value 0>)
i70 = int_lt(i68, 0)
guard_false(i70, descr=<Guard0xffffb0aa62c0>)
jump(p0, p1, i65, p10, p12, p14, i63, p24, p56, p56, i61, descr=TargetToken(281473645544032))
Expected:
i12 = int_is_true(i4)
guard_true(i12, descr=...)
guard_not_invalidated(descr=...)
guard_nonnull_class(p10, ConstClass(W_IntObject), descr=...)
i10p = getfield_gc_i(p10, descr=...)
i10 = int_mul_ovf(2, i10p)
guard_no_overflow(descr=...)
i14 = int_add_ovf(i13, i10)
guard_no_overflow(descr=...)
i13 = int_add_ovf(i14, i9)
guard_no_overflow(descr=...)
setfield_gc(p17, p10, descr=...)
i17 = int_sub_ovf(i4, 1)
guard_no_overflow(descr=...)
guard_not_invalidated?
ticker0 = getfield_raw_i(#, descr=<FieldS pypysig_long_struct_inner.c_value .*>)
ticker_cond0 = int_lt(ticker0, 0)
guard_false(ticker_cond0, descr=...)
jump(..., descr=...)
_______________________ TestMisc.test_range_iter_simple ________________________
self = <pypy.module.pypyjit.test_pypy_c.test_misc.TestMisc object at 0x000000002aa29d38>
def test_range_iter_simple(self):
def main(n):
def g(n):
return range(n)
s = 0
for i in range(n): # ID: for
tmp = g(n)
s += tmp[i] # ID: getitem
a = 0
return s
#
log = self.run(main, [1000])
assert log.result == 1000 * 999 / 2
loop, = log.loops_by_filename(self.filepath)
> assert loop.match(self.RANGE_ITER_STEP_1)
pypy/module/pypyjit/test_pypy_c/test_misc.py:146:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
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 0x000000002a11b050>
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:
guard_not_invalidated(descr=<Guard0xffff7b460bf0>)
i73 = int_lt(i71, i31)
guard_true(i73, descr=<Guard0xffff7b47f070>)
i75 = int_add(i71, 1)
===== HERE =====
p76 = force_token()
setfield_gc(p20, i75, descr=<FieldS pypy.module.__builtin__.functional.W_IntRangeIterator.inst_current 8>)
i80 = int_lt(0, i72)
guard_true(i80, descr=<Guard0xffff7b460c38>)
i83 = int_add(i72, -1)
i86 = int_lt(i71, 0)
guard_false(i86, descr=<Guard0xffff7b47f100>)
i87 = int_ge(i71, i72)
guard_false(i87, descr=<Guard0xffff7b47f160>)
i88 = int_add_ovf(i66, i71)
guard_no_overflow(descr=<Guard0xffff7b47f190>)
i90 = getfield_raw_i(281472831397576, descr=<FieldS pypysig_long_struct_inner.c_value 0>)
i92 = int_lt(i90, 0)
guard_false(i92, descr=<Guard0xffff7b47f1f0>)
jump(p0, p1, p8, p10, i88, i71, i72, p20, i75, i31, p46, i72, p47, descr=TargetToken(281472749920864))
Expected:
guard_not_invalidated?
# W_IntRangeStepOneIterator.next()
i16 = int_lt(i11, i12)
guard_true(i16, descr=...)
i20 = int_add(i11, 1)
setfield_gc(p4, i20, descr=<.* .*W_IntRangeIterator.inst_current .*>)
guard_not_invalidated?
i21 = force_token()
i89 = int_lt(0, i9)
guard_true(i89, descr=...)
i88 = int_add(i9, -1)
# Compared with pypy2, we get these two operations extra.
# I think the reason is that W_IntRangeStepOneIterator is used
# for any 'start' value, which might be negative.
i89 = int_lt(i11, 0)
guard_false(i89, descr=...)
i25 = int_ge(i11, i9)
guard_false(i25, descr=...)
i27 = int_add_ovf(i7, i11)
guard_no_overflow(descr=...)
guard_not_invalidated?
ticker0 = getfield_raw_i(#, descr=<FieldS pypysig_long_struct_inner.c_value .*>)
ticker_cond0 = int_lt(ticker0, 0)
guard_false(ticker_cond0, descr=...)
jump(..., descr=...)
_______________________ TestMisc.test_range_iter_normal ________________________
self = <pypy.module.pypyjit.test_pypy_c.test_misc.TestMisc object at 0x000000002e63c720>
def test_range_iter_normal(self):
# Difference: range(n) => range(1, n).
# This difference doesn't really change anything in pypy3.5,
# but it used to in pypy2.7.
def main(n):
def g(n):
return range(n)
s = 0
for i in range(1, n): # ID: for
tmp = g(n)
s += tmp[i] # ID: getitem
a = 0
return s
#
log = self.run(main, [1000])
assert log.result == 1000 * 999 / 2
loop, = log.loops_by_filename(self.filepath)
> assert loop.match(self.RANGE_ITER_STEP_1)
pypy/module/pypyjit/test_pypy_c/test_misc.py:191:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
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 0x000000002c9779b8>
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:
guard_not_invalidated(descr=<Guard0xffffa2328bf0>)
i73 = int_lt(i71, i31)
guard_true(i73, descr=<Guard0xffffa2347070>)
i75 = int_add(i71, 1)
===== HERE =====
p76 = force_token()
setfield_gc(p20, i75, descr=<FieldS pypy.module.__builtin__.functional.W_IntRangeIterator.inst_current 8>)
i80 = int_lt(0, i72)
guard_true(i80, descr=<Guard0xffffa2328c38>)
i83 = int_add(i72, -1)
i86 = int_lt(i71, 0)
guard_false(i86, descr=<Guard0xffffa2347100>)
i87 = int_ge(i71, i72)
guard_false(i87, descr=<Guard0xffffa2347160>)
i88 = int_add_ovf(i66, i71)
guard_no_overflow(descr=<Guard0xffffa2347190>)
i90 = getfield_raw_i(281473485709000, descr=<FieldS pypysig_long_struct_inner.c_value 0>)
i92 = int_lt(i90, 0)
guard_false(i92, descr=<Guard0xffffa23471f0>)
jump(p0, p1, p8, p10, i88, i71, i72, p20, i75, i31, p46, i72, p47, descr=TargetToken(281473402954336))
Expected:
guard_not_invalidated?
# W_IntRangeStepOneIterator.next()
i16 = int_lt(i11, i12)
guard_true(i16, descr=...)
i20 = int_add(i11, 1)
setfield_gc(p4, i20, descr=<.* .*W_IntRangeIterator.inst_current .*>)
guard_not_invalidated?
i21 = force_token()
i89 = int_lt(0, i9)
guard_true(i89, descr=...)
i88 = int_add(i9, -1)
# Compared with pypy2, we get these two operations extra.
# I think the reason is that W_IntRangeStepOneIterator is used
# for any 'start' value, which might be negative.
i89 = int_lt(i11, 0)
guard_false(i89, descr=...)
i25 = int_ge(i11, i9)
guard_false(i25, descr=...)
i27 = int_add_ovf(i7, i11)
guard_no_overflow(descr=...)
guard_not_invalidated?
ticker0 = getfield_raw_i(#, descr=<FieldS pypysig_long_struct_inner.c_value .*>)
ticker_cond0 = int_lt(ticker0, 0)
guard_false(ticker_cond0, descr=...)
jump(..., descr=...)
___________________ TestMisc.test_dont_trace_every_iteration ___________________
self = <pypy.module.pypyjit.test_pypy_c.test_misc.TestMisc object at 0x00000000315fdad0>
def test_dont_trace_every_iteration(self):
def reference(a, b):
i = sa = 0
while i < 300:
sa += a % b
i += 1
return sa
#
def main(a, b):
i = sa = 0
while i < 300:
if a > 0:
pass
if 1 < b < 2:
pass
sa += a % b
i += 1
return sa
#
log_ref = self.run(reference, [10, 20])
assert log_ref.result == 300 * (10 % 20)
#
log = self.run(main, [10, 20])
assert log.result == 300 * (10 % 20)
assert log.jit_summary.tracing_no == log_ref.jit_summary.tracing_no
loop, = log.loops_by_filename(self.filepath)
> assert loop.match("""
i11 = int_lt(i7, 300)
guard_true(i11, descr=...)
i12 = int_add_ovf(i8, i9)
guard_no_overflow(descr=...)
i14 = int_add(i7, 1)
--TICK--
jump(..., descr=...)
""")
pypy/module/pypyjit/test_pypy_c/test_misc.py:280:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
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 0x000000002cb30b10>
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=<Guard0xffff9cdf2c38>)
i47 = int_lt(i41, 300)
guard_true(i47, descr=<Guard0xffff9ce142c0>)
i48 = int_add_ovf(i39, i37)
guard_no_overflow(descr=<Guard0xffff9ce142f0>)
i50 = int_add(i41, 1)
i52 = getfield_raw_i(281473395531464, descr=<FieldS pypysig_long_struct_inner.c_value 0>)
i54 = int_lt(i52, 0)
guard_false(i54, descr=<Guard0xffff9ce14350>)
jump(p0, p1, p8, p10, i50, i48, i28, i32, i37, descr=TargetToken(281473313604192))
Expected:
i11 = int_lt(i7, 300)
guard_true(i11, descr=...)
i12 = int_add_ovf(i8, i9)
guard_no_overflow(descr=...)
i14 = int_add(i7, 1)
guard_not_invalidated?
ticker0 = getfield_raw_i(#, descr=<FieldS pypysig_long_struct_inner.c_value .*>)
ticker_cond0 = int_lt(ticker0, 0)
guard_false(ticker_cond0, descr=...)
jump(..., descr=...)
_____________________________ TestMisc.test_locals _____________________________
self = <pypy.module.pypyjit.test_pypy_c.test_misc.TestMisc object at 0x0000000030a0c288>
@pytest.mark.skipif("sys.maxint == 2 ** 31 - 1")
def test_locals(self):
def main(n):
res = 0
for i in range(n):
locals()["abc"] = 1
res += locals()["abc"] + locals()["i"]
return res
log = self.run(main, [3000])
loop, = log.loops_by_filename(self.filepath)
> assert loop.match("""
...
i82 = int_add(i76, 1)
setfield_gc(p16, i82, descr=...)
guard_not_invalidated(descr=...)
setarrayitem_gc(p63, 1, i71, descr=...)
setarrayitem_gc(p63, 2, i76, descr=...)
setarrayitem_gc(p63, 0, i77, descr=...)
i87 = int_add_ovf(i71, i82)
guard_no_overflow(descr=...)
--TICK--
i92 = arraylen_gc(p61, descr=...)
i93 = arraylen_gc(p63, descr=...)
jump(..., descr=...)
""")
pypy/module/pypyjit/test_pypy_c/test_misc.py:509:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
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 0x000000002b954918>
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:
guard_not_invalidated(descr=<Guard0xffffb335ed10>)
i70 = int_lt(i68, i28)
guard_true(i70, descr=<Guard0xffffb3380c80>)
i72 = int_add(i68, 1)
setfield_gc(p14, i72, descr=<FieldS pypy.module.__builtin__.functional.W_IntRangeIterator.inst_current 8>)
===== HERE =====
setarrayitem_gc(p55, 1, i63, descr=<ArrayS 8>)
setarrayitem_gc(p55, 2, i68, descr=<ArrayS 8>)
setarrayitem_gc(p55, 0, i69, descr=<ArrayS 8>)
i76 = int_add_ovf(i63, i72)
guard_no_overflow(descr=<Guard0xffffb335ed58>)
i79 = getfield_raw_i(281473770921672, descr=<FieldS pypysig_long_struct_inner.c_value 0>)
i81 = int_lt(i79, 0)
guard_false(i81, descr=<Guard0xffffb3380d70>)
i82 = arraylen_gc(p53, descr=<ArrayP 8>)
i83 = arraylen_gc(p55, descr=<ArrayS 8>)
jump(p0, p1, p5, p8, i76, i68, p14, i72, i28, p40, p43, p48, p53, p55, i69, descr=TargetToken(281473688388192))
Expected:
...
i82 = int_add(i76, 1)
setfield_gc(p16, i82, descr=...)
guard_not_invalidated(descr=...)
setarrayitem_gc(p63, 1, i71, descr=...)
setarrayitem_gc(p63, 2, i76, descr=...)
setarrayitem_gc(p63, 0, i77, descr=...)
i87 = int_add_ovf(i71, i82)
guard_no_overflow(descr=...)
guard_not_invalidated?
ticker0 = getfield_raw_i(#, descr=<FieldS pypysig_long_struct_inner.c_value .*>)
ticker_cond0 = int_lt(ticker0, 0)
guard_false(ticker_cond0, descr=...)
i92 = arraylen_gc(p61, descr=...)
i93 = arraylen_gc(p63, descr=...)
jump(..., descr=...)
_____________________ TestString.test_python3_missing_bchr _____________________
self = <pypy.module.pypyjit.test_pypy_c.test_string.TestString object at 0x000000002a837590>
def test_python3_missing_bchr(self):
# Check that 'bytes([i])' is special-cased into something
# efficient, as Python 3.5 doesn't have a bchr() function or
# anything more direct.
def main(n):
i = 0
result = b''
while i < n:
c = bytes([i])
result += c
i += 1
return i
log = self.run(main, [255])
assert log.result == 255
loop, = log.loops_by_filename(self.filepath)
> assert loop.match("""
# nothing left like allocating a list object or doing any
# residual call
i49 = int_lt(i38, i26)
guard_true(i49, descr=...)
guard_not_invalidated(descr=...)
i51 = int_lt(i38, 256)
guard_true(i51, descr=...)
i53 = int_add(i38, 1)
--TICK--
i58 = strlen(p46)
i60 = int_add(i58, 1)
p61 = newstr(i60)
copystrcontent(p46, p61, 0, 0, i58)
strsetitem(p61, i58, i38)
p62 = newstr(1)
strsetitem(p62, 0, i38)
jump(..., descr=...)
""")
pypy/module/pypyjit/test_pypy_c/test_string.py:26:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
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 0x000000002ab44bf0>
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=<Guard0xffffb797ed58>)
i44 = int_lt(i33, i24)
guard_true(i44, descr=<Guard0xffffb799ed70>)
i46 = int_lt(i33, 256)
guard_true(i46, descr=<Guard0xffffb799edd0>)
i48 = int_add(i33, 1)
i50 = getfield_raw_i(281473844321992, descr=<FieldS pypysig_long_struct_inner.c_value 0>)
i52 = int_lt(i50, 0)
guard_false(i52, descr=<Guard0xffffb799ee30>)
i53 = strlen(p41)
i55 = int_add(i53, 1)
p56 = newstr(i55)
copystrcontent(p41, p56, 0, 0, i53)
strsetitem(p56, i53, i33)
p57 = newstr(1)
strsetitem(p57, 0, i33)
jump(p0, p1, p8, i48, p56, p57, i24, descr=TargetToken(281473761919712))
Expected:
# nothing left like allocating a list object or doing any
# residual call
i49 = int_lt(i38, i26)
guard_true(i49, descr=...)
guard_not_invalidated(descr=...)
i51 = int_lt(i38, 256)
guard_true(i51, descr=...)
i53 = int_add(i38, 1)
guard_not_invalidated?
ticker0 = getfield_raw_i(#, descr=<FieldS pypysig_long_struct_inner.c_value .*>)
ticker_cond0 = int_lt(ticker0, 0)
guard_false(ticker_cond0, descr=...)
i58 = strlen(p46)
i60 = int_add(i58, 1)
p61 = newstr(i60)
copystrcontent(p46, p61, 0, 0, i58)
strsetitem(p61, i58, i38)
p62 = newstr(1)
strsetitem(p62, 0, i38)
jump(..., descr=...)
___________________ TestString.test_lookup_default_encoding ____________________
self = <pypy.module.pypyjit.test_pypy_c.test_string.TestString object at 0x000000002a6e6368>
def test_lookup_default_encoding(self):
def main(n):
i = 0
letters = b'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
uletters = u'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
while i < n:
c = bytes([letters[i % len(uletters)]])
i += (c.decode() == uletters[i % len(uletters)])
return i
log = self.run(main, [300], import_site=True)
assert log.result == 300
loop, = log.loops_by_filename(self.filepath)
assert loop.match("""
i88 = int_lt(i83, i36)
guard_true(i88, descr=...)
guard_not_invalidated(descr=...)
i92 = int_eq(i83, %d)
i94 = call_i(ConstClass(ll_int_py_mod__Signed_Signed), i83, i46, descr=<Calli . ii EF=0 OS=14>)
i97 = int_ge(i94, i53)
guard_false(i97, descr=...)
i98 = strgetitem(p52, i94)
p103 = newstr(1)
strsetitem(p103, 0, i98)
i95 = call_i(ConstClass(_check_utf8), p103, 0, 0, -1, descr=<Calli 8 riii EF=4>)
guard_no_exception(descr=...)
i98 = int_ge(i95, 0)
guard_true(i98, descr=...)
i99 = int_ge(i94, i46)
guard_false(i99, descr=...)
i115 = int_add(i94, 1)
i116 = int_gt(i115, i71)
guard_false(i116, descr=...)
i104 = call_i(ConstClass(_ll_4_str_eq_slice_char__rpy_stringPtr_Signed_Signed_Char), p65, i94, 1, i98, descr=<Calli 8 riii EF=0 OS=27>)
guard_true(i104, descr=...)
i124 = int_add(i83, 1)
--TICK--
jump(..., descr=...)
> """ % (-sys.maxint-1,))
pypy/module/pypyjit/test_pypy_c/test_string.py:85:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
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 0x0000000025f3e4b8>
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=<Guard0xffff910610b8>)
i75 = int_lt(i70, i34)
guard_true(i75, descr=<Guard0xffff9108d370>)
i77 = int_eq(i70, -9223372036854775808)
i79 = call_i(ConstClass(ll_int_py_mod__Signed_Signed), i70, i38, descr=<Calli 8 ii EF=0 OS=14>)
i80 = int_ge(i79, i47)
guard_false(i80, descr=<Guard0xffff91061100>)
i81 = strgetitem(p46, i79)
p83 = newstr(1)
strsetitem(p83, 0, i81)
i88 = call_i(ConstClass(_check_utf8), p83, 0, 0, -1, descr=<Calli 8 riii EF=4>)
guard_no_exception(descr=<Guard0xffff91061148>)
i91 = int_ge(i88, 0)
guard_true(i91, descr=<Guard0xffff9108d400>)
i92 = int_ge(i79, i38)
guard_false(i92, descr=<Guard0xffff9108d460>)
i94 = int_add(i79, 1)
i95 = int_gt(i94, i61)
guard_false(i95, descr=<Guard0xffff9108d4c0>)
i97 = call_i(ConstClass(_ll_4_str_eq_slice_char__rpy_stringPtr_Signed_Signed_Char), p60, i79, 1, i81, descr=<Calli 8 riii EF=0 OS=27>)
guard_true(i97, descr=<Guard0xffff91061190>)
i99 = int_add(i70, 1)
i101 = getfield_raw_i(281473196302024, descr=<FieldS pypysig_long_struct_inner.c_value 0>)
i103 = int_lt(i101, 0)
guard_false(i103, descr=<Guard0xffff9108d550>)
jump(p0, p1, p8, i99, p12, p14, p83, i34, i38, i47, p46, i61, p60, descr=TargetToken(281473114825568))
Expected:
i88 = int_lt(i83, i36)
guard_true(i88, descr=...)
guard_not_invalidated(descr=...)
i92 = int_eq(i83, -9223372036854775808)
i94 = call_i(ConstClass(ll_int_py_mod__Signed_Signed), i83, i46, descr=<Calli . ii EF=0 OS=14>)
i97 = int_ge(i94, i53)
guard_false(i97, descr=...)
i98 = strgetitem(p52, i94)
p103 = newstr(1)
strsetitem(p103, 0, i98)
i95 = call_i(ConstClass(_check_utf8), p103, 0, 0, -1, descr=<Calli 8 riii EF=4>)
guard_no_exception(descr=...)
i98 = int_ge(i95, 0)
guard_true(i98, descr=...)
i99 = int_ge(i94, i46)
guard_false(i99, descr=...)
i115 = int_add(i94, 1)
i116 = int_gt(i115, i71)
guard_false(i116, descr=...)
i104 = call_i(ConstClass(_ll_4_str_eq_slice_char__rpy_stringPtr_Signed_Signed_Char), p65, i94, 1, i98, descr=<Calli 8 riii EF=0 OS=27>)
guard_true(i104, descr=...)
i124 = int_add(i83, 1)
guard_not_invalidated?
ticker0 = getfield_raw_i(#, descr=<FieldS pypysig_long_struct_inner.c_value .*>)
ticker_cond0 = int_lt(ticker0, 0)
guard_false(ticker_cond0, descr=...)
jump(..., descr=...)
_________________________ TestString.test_int_base_16 __________________________
self = <pypy.module.pypyjit.test_pypy_c.test_string.TestString object at 0x000000002b39b2f0>
def test_int_base_16(self):
def main(n):
i = 1
while i < n:
digits = '0123456789'
i += int(digits[i % len(digits)], 16)
return i
log = self.run(main, [1100], import_site=True)
assert log.result == main(1100)
loop, = log.loops_by_filename(self.filepath)
if sys.maxint > 2**32:
args = (63, -3689348814741910323, 3)
else:
args = (31, -858993459, 3)
assert loop.match("""
i11 = int_lt(i6, i7)
guard_true(i11, descr=...)
guard_not_invalidated(descr=...)
i13 = int_eq(i6, %d) # value provided below
# "mod 10" block:
i79 = int_rshift(i6, %d)
i80 = int_xor(i6, i79)
i82 = uint_mul_high(i80, %d)
i84 = uint_rshift(i82, %d)
i85 = int_xor(i84, i79)
i87 = int_mul(i85, 10)
i19 = int_sub(i6, i87)
i85 = int_add(i19, 1) # not used
p25 = newstr(1)
i23 = strgetitem(ConstPtr(ptr92), i19)
strsetitem(p25, 0, i23)
i107 = call_i(ConstClass(string_to_int), p25, 16, 1, 1, 0, 1, descr=<Calli . riiiii EF=4>)
guard_no_exception(descr=...)
i95 = int_add_ovf(i6, i107)
guard_no_overflow(descr=...)
--TICK--
jump(..., descr=...)
> """ % ((-sys.maxint-1,)+args))
pypy/module/pypyjit/test_pypy_c/test_string.py:127:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
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 0x000000002b9f0ec8>
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=<Guard0xffffb3a82de8>)
i63 = int_lt(i58, i30)
guard_true(i63, descr=<Guard0xffffb3a9d520>)
i65 = int_eq(i58, -9223372036854775808)
i67 = int_rshift(i58, 63)
i68 = int_xor(i58, i67)
i70 = uint_mul_high(i68, -3689348814741910323)
i72 = uint_rshift(i70, 3)
i73 = int_xor(i72, i67)
i75 = int_mul(i73, 10)
i76 = int_sub(i58, i75)
i78 = int_add(i76, 1)
p79 = newstr(1)
i81 = strgetitem(ConstPtr(ptr80), i76)
strsetitem(p79, 0, i81)
i88 = call_i(ConstClass(string_to_int), p79, 16, 1, 1, 0, 1, descr=<Calli 8 riiiii EF=4>)
guard_no_exception(descr=<Guard0xffffb3a82e30>)
i89 = int_add_ovf(i58, i88)
guard_no_overflow(descr=<Guard0xffffb3a9d550>)
i91 = getfield_raw_i(281473777213128, descr=<FieldS pypysig_long_struct_inner.c_value 0>)
i93 = int_lt(i91, 0)
guard_false(i93, descr=<Guard0xffffb3a9d5b0>)
jump(p0, p1, p8, i89, i30, descr=TargetToken(281473695875808))
Expected:
i11 = int_lt(i6, i7)
guard_true(i11, descr=...)
guard_not_invalidated(descr=...)
i13 = int_eq(i6, -9223372036854775808) # value provided below
# "mod 10" block:
i79 = int_rshift(i6, 63)
i80 = int_xor(i6, i79)
i82 = uint_mul_high(i80, -3689348814741910323)
i84 = uint_rshift(i82, 3)
i85 = int_xor(i84, i79)
i87 = int_mul(i85, 10)
i19 = int_sub(i6, i87)
i85 = int_add(i19, 1) # not used
p25 = newstr(1)
i23 = strgetitem(ConstPtr(ptr92), i19)
strsetitem(p25, 0, i23)
i107 = call_i(ConstClass(string_to_int), p25, 16, 1, 1, 0, 1, descr=<Calli . riiiii EF=4>)
guard_no_exception(descr=...)
i95 = int_add_ovf(i6, i107)
guard_no_overflow(descr=...)
guard_not_invalidated?
ticker0 = getfield_raw_i(#, descr=<FieldS pypysig_long_struct_inner.c_value .*>)
ticker_cond0 = int_lt(ticker0, 0)
guard_false(ticker_cond0, descr=...)
jump(..., descr=...)
___________________________ TestString.test_str_mod ____________________________
self = <pypy.module.pypyjit.test_pypy_c.test_string.TestString object at 0x000000002ca3c720>
def test_str_mod(self):
def main(n):
s = 0
while n > 0:
s += len('%d %d' % (n, n))
n -= 1
return s
log = self.run(main, [1000])
assert log.result == main(1000)
loop, = log.loops_by_filename(self.filepath)
> assert loop.match("""
i79 = int_gt(i74, 0)
guard_true(i79, descr=...)
guard_not_invalidated(descr=...)
p80 = call_r(ConstClass(ll_int2dec__Signed), i74, descr=<Callr . i EF=3>)
guard_no_exception(descr=...)
i85 = strlen(p80)
p86 = new(descr=<SizeDescr .+>)
p88 = newstr(23)
{{{
setfield_gc(p86, 0, descr=<FieldS stringbuilder.current_pos .+>)
setfield_gc(p86, p88, descr=<FieldP stringbuilder.current_buf .+>)
setfield_gc(p86, 23, descr=<FieldS stringbuilder.current_end .+>)
setfield_gc(p86, 23, descr=<FieldS stringbuilder.total_size .+>)
}}}
call_n(ConstClass(ll_append_res0__stringbuilderPtr_rpy_stringPtr), p86, p80, descr=<Callv 0 rr EF=5>)
guard_no_exception(descr=...)
i89 = getfield_gc_i(p86, descr=<FieldS stringbuilder.current_pos .+>)
i90 = getfield_gc_i(p86, descr=<FieldS stringbuilder.current_end .+>)
i91 = int_eq(i89, i90)
cond_call(i91, ConstClass(ll_grow_by__stringbuilderPtr_Signed), p86, 1, descr=<Callv 0 ri EF=5>)
guard_no_exception(descr=...)
i92 = getfield_gc_i(p86, descr=<FieldS stringbuilder.current_pos .+>)
i93 = int_add(i92, 1)
p94 = getfield_gc_r(p86, descr=<FieldP stringbuilder.current_buf .+>)
strsetitem(p94, i92, 32)
setfield_gc(p86, i93, descr=<FieldS stringbuilder.current_pos .+>)
call_n(ConstClass(ll_append_res0__stringbuilderPtr_rpy_stringPtr), p86, p80, descr=<Callv 0 rr EF=5>)
guard_no_exception(descr=...)
p95 = call_r(..., descr=<Callr . r EF=5>) # ll_build
guard_no_exception(descr=...)
i96 = call_i(ConstClass(codepoints_in_utf8), p95, 0, _, descr=<Calli . rii EF=4>)
guard_no_exception(descr=...)
i969 = int_lt(i96, 0)
guard_false(i969, descr=...)
i97 = int_add_ovf(i71, i96)
guard_no_overflow(descr=...)
i98 = int_add(i74, -1)
--TICK--
jump(..., descr=...)
""")
pypy/module/pypyjit/test_pypy_c/test_string.py:140:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
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 0x000000002d576cd0>
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=<Guard0xffff947c0d58>)
i65 = int_gt(i59, 0)
guard_true(i65, descr=<Guard0xffff947e26b0>)
p67 = call_r(ConstClass(ll_int2dec__Signed), i59, descr=<Callr 8 i EF=3>)
guard_no_exception(descr=<Guard0xffff947c0da0>)
i68 = strlen(p67)
p69 = new(descr=<SizeDescr 48>)
p71 = newstr(23)
setfield_gc(p69, p71, descr=<FieldP stringbuilder.current_buf 8>)
setfield_gc(p69, 0, descr=<FieldS stringbuilder.current_pos 16>)
setfield_gc(p69, 23, descr=<FieldS stringbuilder.current_end 24>)
setfield_gc(p69, 23, descr=<FieldS stringbuilder.total_size 32>)
call_n(ConstClass(ll_append_res0__stringbuilderPtr_rpy_stringPtr), p69, p67, descr=<Callv 0 rr EF=5>)
guard_no_exception(descr=<Guard0xffff947c0de8>)
i75 = getfield_gc_i(p69, descr=<FieldS stringbuilder.current_pos 16>)
i76 = getfield_gc_i(p69, descr=<FieldS stringbuilder.current_end 24>)
i77 = int_eq(i75, i76)
cond_call(i77, ConstClass(ll_grow_by__stringbuilderPtr_Signed), p69, 1, descr=<Callv 0 ri EF=5>)
guard_no_exception(descr=<Guard0xffff947c0e30>)
i80 = getfield_gc_i(p69, descr=<FieldS stringbuilder.current_pos 16>)
i82 = int_add(i80, 1)
p83 = getfield_gc_r(p69, descr=<FieldP stringbuilder.current_buf 8>)
strsetitem(p83, i80, 32)
setfield_gc(p69, i82, descr=<FieldS stringbuilder.current_pos 16>)
call_n(ConstClass(ll_append_res0__stringbuilderPtr_rpy_stringPtr), p69, p67, descr=<Callv 0 rr EF=5>)
guard_no_exception(descr=<Guard0xffff947c0e78>)
p87 = call_r(ConstClass(ll_build_trampoline__v1889___simple_call__function_), p69, descr=<Callr 8 r EF=5>)
guard_no_exception(descr=<Guard0xffff947c0ec0>)
i91 = call_i(ConstClass(codepoints_in_utf8), p87, 0, 9223372036854775807, descr=<Calli 8 rii EF=4>)
guard_no_exception(descr=<Guard0xffff947c0f08>)
i93 = int_lt(i91, 0)
guard_false(i93, descr=<Guard0xffff947e2710>)
i94 = int_add_ovf(i57, i91)
guard_no_overflow(descr=<Guard0xffff947e2740>)
i96 = int_add(i59, -1)
i98 = getfield_raw_i(281473255022280, descr=<FieldS pypysig_long_struct_inner.c_value 0>)
i100 = int_lt(i98, 0)
guard_false(i100, descr=<Guard0xffff947e27a0>)
jump(p0, p1, i96, i94, descr=TargetToken(281473172890208))
Expected:
i79 = int_gt(i74, 0)
guard_true(i79, descr=...)
guard_not_invalidated(descr=...)
p80 = call_r(ConstClass(ll_int2dec__Signed), i74, descr=<Callr . i EF=3>)
guard_no_exception(descr=...)
i85 = strlen(p80)
p86 = new(descr=<SizeDescr .+>)
p88 = newstr(23)
{{{
setfield_gc(p86, 0, descr=<FieldS stringbuilder.current_pos .+>)
setfield_gc(p86, p88, descr=<FieldP stringbuilder.current_buf .+>)
setfield_gc(p86, 23, descr=<FieldS stringbuilder.current_end .+>)
setfield_gc(p86, 23, descr=<FieldS stringbuilder.total_size .+>)
}}}
call_n(ConstClass(ll_append_res0__stringbuilderPtr_rpy_stringPtr), p86, p80, descr=<Callv 0 rr EF=5>)
guard_no_exception(descr=...)
i89 = getfield_gc_i(p86, descr=<FieldS stringbuilder.current_pos .+>)
i90 = getfield_gc_i(p86, descr=<FieldS stringbuilder.current_end .+>)
i91 = int_eq(i89, i90)
cond_call(i91, ConstClass(ll_grow_by__stringbuilderPtr_Signed), p86, 1, descr=<Callv 0 ri EF=5>)
guard_no_exception(descr=...)
i92 = getfield_gc_i(p86, descr=<FieldS stringbuilder.current_pos .+>)
i93 = int_add(i92, 1)
p94 = getfield_gc_r(p86, descr=<FieldP stringbuilder.current_buf .+>)
strsetitem(p94, i92, 32)
setfield_gc(p86, i93, descr=<FieldS stringbuilder.current_pos .+>)
call_n(ConstClass(ll_append_res0__stringbuilderPtr_rpy_stringPtr), p86, p80, descr=<Callv 0 rr EF=5>)
guard_no_exception(descr=...)
p95 = call_r(..., descr=<Callr . r EF=5>) # ll_build
guard_no_exception(descr=...)
i96 = call_i(ConstClass(codepoints_in_utf8), p95, 0, _, descr=<Calli . rii EF=4>)
guard_no_exception(descr=...)
i969 = int_lt(i96, 0)
guard_false(i969, descr=...)
i97 = int_add_ovf(i71, i96)
guard_no_overflow(descr=...)
i98 = int_add(i74, -1)
guard_not_invalidated?
ticker0 = getfield_raw_i(#, descr=<FieldS pypysig_long_struct_inner.c_value .*>)
ticker_cond0 = int_lt(ticker0, 0)
guard_false(ticker_cond0, descr=...)
jump(..., descr=...)
_________________________ TestString.test_lookup_codec _________________________
self = <pypy.module.pypyjit.test_pypy_c.test_string.TestString object at 0x000000002f0a6f70>
def test_lookup_codec(self):
log = self.run("""
import codecs
def main(n):
for i in range(n):
codecs.lookup('utf8')
return i
""", [1000])
loop, = log.loops_by_filename(self.filepath)
> assert loop.match("""
i45 = int_lt(i43, i26)
guard_true(i45, descr=...)
i46 = int_add(i43, 1)
setfield_gc(p15, i46, descr=<FieldS pypy.module.__builtin__.functional.W_IntRangeIterator.inst_current 8>)
guard_not_invalidated(descr=...)
--TICK--
jump(..., descr=...)
""")
pypy/module/pypyjit/test_pypy_c/test_string.py:256:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
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 0x000000002e86f6e0>
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=<Guard0xffff7c74ab18>)
i32 = int_lt(i31, i23)
guard_true(i32, descr=<Guard0xffff7c759d00>)
i34 = int_add(i31, 1)
i36 = getfield_raw_i(281472852369096, descr=<FieldS pypysig_long_struct_inner.c_value 0>)
setfield_gc(p12, i34, descr=<FieldS pypy.module.__builtin__.functional.W_IntRangeIterator.inst_current 8>)
i38 = int_lt(i36, 0)
guard_false(i38, descr=<Guard0xffff7c74ab60>)
jump(p0, p1, p8, i31, p12, i34, i23, descr=TargetToken(281472769753696))
Expected:
i45 = int_lt(i43, i26)
guard_true(i45, descr=...)
i46 = int_add(i43, 1)
setfield_gc(p15, i46, descr=<FieldS pypy.module.__builtin__.functional.W_IntRangeIterator.inst_current 8>)
guard_not_invalidated(descr=...)
guard_not_invalidated?
ticker0 = getfield_raw_i(#, descr=<FieldS pypysig_long_struct_inner.c_value .*>)
ticker_cond0 = int_lt(ticker0, 0)
guard_false(ticker_cond0, descr=...)
jump(..., descr=...)
_________________________ TestString.test_decode_ascii _________________________
self = <pypy.module.pypyjit.test_pypy_c.test_string.TestString object at 0x000000002d0225d0>
def test_decode_ascii(self):
log = self.run("""
def main(n):
for i in range(n):
(b"x" * (i & 15)).decode('ascii')
return i
""", [1000])
loop, = log.loops_by_filename(self.filepath)
> assert loop.match("""
i49 = int_lt(i47, i24)
guard_true(i49, descr=...)
i50 = int_add(i47, 1)
i53 = int_and(i47, 15)
setfield_gc(p15, i50, descr=<FieldS pypy.module.__builtin__.functional.W_IntRangeIterator.inst_current 8>)
i55 = int_le(i53, 0)
guard_false(i55, descr=...)
i56 = int_eq(i53, 1)
guard_false(i56, descr=...)
p80 = call_r(ConstClass(ll_char_mul__Char_Signed), 120, i53, descr=<Callr . ii EF=3>)
guard_no_exception(descr=...)
guard_not_invalidated(descr=...)
i59 = call_i(ConstClass(first_non_ascii_char), p80, descr=<Calli . r EF=4>)
guard_no_exception(descr=...)
i61 = int_lt(i59, 0)
guard_true(i61, descr=...)
i62 = strlen(p80)
--TICK--
jump(..., descr=...)
""")
pypy/module/pypyjit/test_pypy_c/test_string.py:274:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
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 0x000000002fc90608>
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=<Guard0xffff84244ba8>)
i47 = int_lt(i46, i23)
guard_true(i47, descr=<Guard0xffff84262440>)
i49 = int_add(i46, 1)
i51 = int_and(i46, 15)
setfield_gc(p12, i49, descr=<FieldS pypy.module.__builtin__.functional.W_IntRangeIterator.inst_current 8>)
i53 = int_le(i51, 0)
guard_false(i53, descr=<Guard0xffff84244bf0>)
i55 = int_eq(i51, 1)
guard_false(i55, descr=<Guard0xffff842624d0>)
p58 = call_r(ConstClass(ll_char_mul__Char_Signed), 120, i51, descr=<Callr 8 ii EF=3>)
guard_no_exception(descr=<Guard0xffff84244c38>)
i60 = call_i(ConstClass(first_non_ascii_char), p58, descr=<Calli 8 r EF=4>)
guard_no_exception(descr=<Guard0xffff84244c80>)
i62 = int_lt(i60, 0)
guard_true(i62, descr=<Guard0xffff84262530>)
i63 = strlen(p58)
i65 = getfield_raw_i(281472980295368, descr=<FieldS pypysig_long_struct_inner.c_value 0>)
i67 = int_lt(i65, 0)
guard_false(i67, descr=<Guard0xffff84262590>)
jump(p0, p1, p8, i46, p12, i49, i23, descr=TargetToken(281472898704032))
Expected:
i49 = int_lt(i47, i24)
guard_true(i49, descr=...)
i50 = int_add(i47, 1)
i53 = int_and(i47, 15)
setfield_gc(p15, i50, descr=<FieldS pypy.module.__builtin__.functional.W_IntRangeIterator.inst_current 8>)
i55 = int_le(i53, 0)
guard_false(i55, descr=...)
i56 = int_eq(i53, 1)
guard_false(i56, descr=...)
p80 = call_r(ConstClass(ll_char_mul__Char_Signed), 120, i53, descr=<Callr . ii EF=3>)
guard_no_exception(descr=...)
guard_not_invalidated(descr=...)
i59 = call_i(ConstClass(first_non_ascii_char), p80, descr=<Calli . r EF=4>)
guard_no_exception(descr=...)
i61 = int_lt(i59, 0)
guard_true(i61, descr=...)
i62 = strlen(p80)
guard_not_invalidated?
ticker0 = getfield_raw_i(#, descr=<FieldS pypysig_long_struct_inner.c_value .*>)
ticker_cond0 = int_lt(ticker0, 0)
guard_false(ticker_cond0, descr=...)
jump(..., descr=...)
___________ TestString.test_unicode_indexing_small_constant_indices ____________
self = <pypy.module.pypyjit.test_pypy_c.test_string.TestString object at 0x000000002eff6f70>
def test_unicode_indexing_small_constant_indices(self):
log = self.run("""
l = [u"abä", u"cdä", u"äü", u"éé", u"–—¿"] * 1000
def main(n):
global s
for u in l:
s = u[0] + u[1] + u[-1] # ID: index
len(u)
return len(s)
""", [1000])
loop, = log.loops_by_filename(self.filepath)
> assert loop.match_by_id('index', '''
i77 = getfield_gc_i(p73, descr=<FieldS pypy.objspace.std.unicodeobject.W_UnicodeObject.inst__length .*>)
p78 = getfield_gc_r(p73, descr=<FieldP pypy.objspace.std.unicodeobject.W_UnicodeObject.inst__utf8 .* pure>)
i79 = strlen(p78)
i80 = int_eq(i77, i79)
guard_false(i80, descr=...) # check not ascii
i82 = int_ge(0, i77)
guard_false(i82, descr=...)
i85 = call_i(ConstClass(next_codepoint_pos_dont_look_inside), p78, 0, descr=...)
i86 = int_gt(i85, i79)
guard_false(i86, descr=...)
i88 = int_ge(1, i77)
guard_false(i88, descr=...)
i90 = call_i(ConstClass(next_codepoint_pos_dont_look_inside), p78, i85, descr=...)
i91 = int_gt(i90, i79)
guard_false(i91, descr=...)
i92 = int_sub(i90, i85)
i94 = int_add(-1, i77)
i96 = call_i(ConstClass(prev_codepoint_pos_dont_look_inside), p78, i79, descr=...)
i97 = int_sub(i79, i96)
guard_not_invalidated(descr=...)
''')
pypy/module/pypyjit/test_pypy_c/test_string.py:320:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pypy/module/pypyjit/test_pypy_c/model.py:182: in match_by_id
return matcher.match(expected_src, ignore_ops=ignore_ops)
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:408: in match_op
self._assert(op != '--end--', 'got less ops than expected')
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.pypyjit.test_pypy_c.model.OpMatcher object at 0x000000002ec7d1a0>
cond = False, message = 'got less ops than expected'
def _assert(self, cond, message):
if not cond:
> raise InvalidMatch(message, frame=sys._getframe(1))
E InvalidMatch: got less ops than expected
pypy/module/pypyjit/test_pypy_c/model.py:402: InvalidMatch
----------------------------- Captured stdout call -----------------------------
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Loops don't match
=================
loop id = 'index'
('got less ops than expected',)
<could not determine information>
Ignore ops: []
Got:
i72 = getfield_gc_i(p68, descr=<FieldS pypy.objspace.std.unicodeobject.W_UnicodeObject.inst__length 16 pure>)
p73 = getfield_gc_r(p68, descr=<FieldP pypy.objspace.std.unicodeobject.W_UnicodeObject.inst__utf8 24 pure>)
i74 = strlen(p73)
i75 = int_eq(i72, i74)
guard_false(i75, descr=<Guard0xffffb4a10b30>)
i77 = int_ge(0, i72)
guard_false(i77, descr=<Guard0xffffb4a10b90>)
i80 = call_i(ConstClass(next_codepoint_pos_dont_look_inside), p73, 0, descr=<Calli 8 ri EF=0>)
i81 = int_gt(i80, i74)
guard_false(i81, descr=<Guard0xffffb49f2c80>)
i83 = int_ge(1, i72)
guard_false(i83, descr=<Guard0xffffb4a10c20>)
i85 = call_i(ConstClass(next_codepoint_pos_dont_look_inside), p73, i80, descr=<Calli 8 ri EF=0>)
i86 = int_gt(i85, i74)
guard_false(i86, descr=<Guard0xffffb49f2cc8>)
i87 = int_sub(i85, i80)
i89 = int_add(-1, i72)
i91 = call_i(ConstClass(prev_codepoint_pos_dont_look_inside), p73, i74, descr=<Calli 8 ri EF=0>)
i92 = int_sub(i74, i91)
===== HERE =====
Expected:
i77 = getfield_gc_i(p73, descr=<FieldS pypy.objspace.std.unicodeobject.W_UnicodeObject.inst__length .*>)
p78 = getfield_gc_r(p73, descr=<FieldP pypy.objspace.std.unicodeobject.W_UnicodeObject.inst__utf8 .* pure>)
i79 = strlen(p78)
i80 = int_eq(i77, i79)
guard_false(i80, descr=...) # check not ascii
i82 = int_ge(0, i77)
guard_false(i82, descr=...)
i85 = call_i(ConstClass(next_codepoint_pos_dont_look_inside), p78, 0, descr=...)
i86 = int_gt(i85, i79)
guard_false(i86, descr=...)
i88 = int_ge(1, i77)
guard_false(i88, descr=...)
i90 = call_i(ConstClass(next_codepoint_pos_dont_look_inside), p78, i85, descr=...)
i91 = int_gt(i90, i79)
guard_false(i91, descr=...)
i92 = int_sub(i90, i85)
i94 = int_add(-1, i77)
i96 = call_i(ConstClass(prev_codepoint_pos_dont_look_inside), p78, i79, descr=...)
i97 = int_sub(i79, i96)
guard_not_invalidated(descr=...)
_______________________ TestStruct.test_struct_function ________________________
self = <pypy.module.pypyjit.test_pypy_c.test_struct.TestStruct object at 0x000000002cdce368>
def test_struct_function(self):
def main(n):
import struct
i = 1
while i < n:
buf = struct.pack("<i", i) # ID: pack
x = struct.unpack("<i", buf)[0] # ID: unpack
i += x // i
return i
log = self.run(main, [1000])
assert log.result == main(1000)
loop, = log.loops_by_filename(self.filepath)
# This could, of course stand some improvement, to remove all these
# arithmatic ops, but we've removed all the core overhead.
if sys.byteorder == 'little':
# on little endian machines, we take the fast path and store the
# value using gc_store_indexed
assert loop.match_by_id("pack", """
dummy_get_utf8?
guard_not_invalidated(descr=...)
# struct.pack
%s
p75 = newstr(4)
gc_store_indexed(p75, 0, _, 1, _, 4, descr=...)
> """ % extra)
pypy/module/pypyjit/test_pypy_c/test_struct.py:43:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pypy/module/pypyjit/test_pypy_c/model.py:182: in match_by_id
return matcher.match(expected_src, ignore_ops=ignore_ops)
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 0x000000002dea5a98>
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 = 'pack'
('operation mismatch',)
<could not determine information>
Ignore ops: []
Got:
===== HERE =====
i68 = int_ge(i61, -2147483648)
guard_true(i68, descr=<Guard0xffff7ead3070>)
i70 = int_le(i61, 2147483647)
guard_true(i70, descr=<Guard0xffff7ead30d0>)
p72 = newstr(4)
gc_store_indexed(p72, 0, i61, 1, 24, 4, descr=<ArrayS 4>)
Expected:
dummy_get_utf8?
guard_not_invalidated(descr=...)
# struct.pack
i8 = int_ge(i4, -2147483648)
guard_true(i8, descr=...)
i9 = int_le(i4, 2147483647)
guard_true(i9, descr=...)
p75 = newstr(4)
gc_store_indexed(p75, 0, _, 1, _, 4, descr=...)
________________________ TestStruct.test_struct_object _________________________
self = <pypy.module.pypyjit.test_pypy_c.test_struct.TestStruct object at 0x000000002de211d8>
def test_struct_object(self):
def main(n):
import struct
s = struct.Struct("ii")
i = 1
while i < n:
buf = s.pack(-1, i) # ID: pack
x = s.unpack(buf)[1] # ID: unpack
i += x // i
return i
log = self.run(main, [1000])
assert log.result == main(1000)
if sys.byteorder == 'little':
loop, = log.loops_by_filename(self.filepath)
assert loop.match_by_id('pack', """
dummy_get_utf8?
guard_not_invalidated(descr=...)
# struct.pack
p85 = newstr(8)
gc_store_indexed(p85, 0, -1, 1, _, 4, descr=...)
%s
gc_store_indexed(p85, 4, _, 1, _, 4, descr=...)
> """ % extra)
pypy/module/pypyjit/test_pypy_c/test_struct.py:108:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pypy/module/pypyjit/test_pypy_c/model.py:182: in match_by_id
return matcher.match(expected_src, ignore_ops=ignore_ops)
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 0x000000002d669b08>
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 = 'pack'
('operation mismatch',)
<could not determine information>
Ignore ops: []
Got:
===== HERE =====
p81 = newstr(8)
gc_store_indexed(p81, 0, -1, 1, 24, 4, descr=<ArrayS 4>)
i88 = int_ge(i74, -2147483648)
guard_true(i88, descr=<Guard0xffffb2ff2d10>)
i90 = int_le(i74, 2147483647)
guard_true(i90, descr=<Guard0xffffb3015280>)
gc_store_indexed(p81, 4, i74, 1, 24, 4, descr=<ArrayS 4>)
Expected:
dummy_get_utf8?
guard_not_invalidated(descr=...)
# struct.pack
p85 = newstr(8)
gc_store_indexed(p85, 0, -1, 1, _, 4, descr=...)
i8 = int_ge(i4, -2147483648)
guard_true(i8, descr=...)
i9 = int_le(i4, 2147483647)
guard_true(i9, descr=...)
gc_store_indexed(p85, 4, _, 1, _, 4, descr=...)
______________________ TestStruct.test_unpack_raw_buffer _______________________
self = <pypy.module.pypyjit.test_pypy_c.test_struct.TestStruct object at 0x000000002ca8a2f8>
def test_unpack_raw_buffer(self):
def main(n):
import array
import struct
buf = struct.pack('H', 0x1234)
buf = array.array('b', buf)
i = 1
res = 0
while i < n:
val = struct.unpack("h", buf)[0] # ID: unpack
res += val
i += 1
return res
log = self.run(main, [1000])
assert log.result == main(1000)
loop, = log.loops_by_filename(self.filepath)
> assert loop.match_by_id('unpack', """
guard_not_invalidated(descr=...)
i65 = raw_load_i(i49, 0, descr=<ArrayS 2>)
""")
pypy/module/pypyjit/test_pypy_c/test_struct.py:133:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pypy/module/pypyjit/test_pypy_c/model.py:182: in match_by_id
return matcher.match(expected_src, ignore_ops=ignore_ops)
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 0x000000002f0ad590>
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 = 'unpack'
('operation mismatch',)
<could not determine information>
Ignore ops: []
Got:
===== HERE =====
i65 = raw_load_i(i49, 0, descr=<ArrayS 2>)
Expected:
guard_not_invalidated(descr=...)
i65 = raw_load_i(i49, 0, descr=<ArrayS 2>)
_______________________ TestStruct.test_unpack_bytearray _______________________
self = <pypy.module.pypyjit.test_pypy_c.test_struct.TestStruct object at 0x000000002aa39248>
def test_unpack_bytearray(self):
def main(n):
import struct
buf = struct.pack('H', 0x1234)
buf = bytearray(buf)
i = 1
res = 0
while i < n:
val = struct.unpack("h", buf)[0] # ID: unpack
res += val
i += 1
return res
log = self.run(main, [1000])
assert log.result == main(1000)
loop, = log.loops_by_filename(self.filepath)
# the offset of gc_load_indexed_i used to be the constant 0. However,
# now it is 'i46' because we need to add 0 to
# W_BytearrayObject._offset
> assert loop.match_by_id('unpack', """
guard_not_invalidated(descr=...)
setfield_gc(_, _, descr=<FieldS pypy.objspace.std.bytearrayobject.W_BytearrayObject.inst__exports \d+>)
i70 = gc_load_indexed_i(p48, i46, 1, _, -2)
""")
pypy/module/pypyjit/test_pypy_c/test_struct.py:156:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pypy/module/pypyjit/test_pypy_c/model.py:182: in match_by_id
return matcher.match(expected_src, ignore_ops=ignore_ops)
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 0x000000002e92e218>
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 = 'unpack'
('operation mismatch',)
<could not determine information>
Ignore ops: []
Got:
===== HERE =====
setfield_gc(p12, i43, descr=<FieldS pypy.objspace.std.bytearrayobject.W_BytearrayObject.inst__exports 16>)
i74 = gc_load_indexed_i(p52, i46, 1, 16, -2)
Expected:
guard_not_invalidated(descr=...)
setfield_gc(_, _, descr=<FieldS pypy.objspace.std.bytearrayobject.W_BytearrayObject.inst__exports \d+>)
i70 = gc_load_indexed_i(p48, i46, 1, _, -2)
_____________________ TestStruct.test_pack_into_raw_buffer _____________________
self = <pypy.module.pypyjit.test_pypy_c.test_struct.TestStruct object at 0x000000002e6f58a0>
def test_pack_into_raw_buffer(self):
def main(n):
import array
import struct
buf = array.array('b', b'\x00'*8)
i = 1
while i < n:
struct.pack_into("h", buf, 4, i) # ID: pack_into
i += 1
return i
log = self.run(main, [1000])
assert log.result == main(1000)
loop, = log.loops_by_filename(self.filepath)
> assert loop.match_by_id('pack_into', """\
guard_not_invalidated(descr=...)
i65 = int_le(i58, 32767)
guard_true(i65, descr=...)
raw_store(i55, 4, i58, descr=<ArrayS 2>)
""")
pypy/module/pypyjit/test_pypy_c/test_struct.py:175:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pypy/module/pypyjit/test_pypy_c/model.py:182: in match_by_id
return matcher.match(expected_src, ignore_ops=ignore_ops)
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 0x000000002c1bff68>
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 = 'pack_into'
('operation mismatch',)
<could not determine information>
Ignore ops: []
Got:
===== HERE =====
setfield_gc(p14, i45, descr=<FieldS pypy.module.array.interp_array.W_ArrayBase.inst__exports 16>)
i65 = int_le(i58, 32767)
guard_true(i65, descr=<Guard0xffff7e94ad58>)
raw_store(i55, 4, i58, descr=<ArrayS 2>)
Expected:
guard_not_invalidated(descr=...)
i65 = int_le(i58, 32767)
guard_true(i65, descr=...)
raw_store(i55, 4, i58, descr=<ArrayS 2>)
_____________________ TestStruct.test_pack_into_bytearray ______________________
self = <pypy.module.pypyjit.test_pypy_c.test_struct.TestStruct object at 0x000000002d0b9670>
def test_pack_into_bytearray(self):
def main(n):
import struct
buf = bytearray(8)
i = 1
while i < n:
struct.pack_into("h", buf, 4, i) # ID: pack_into
i += 1
return i
log = self.run(main, [1000])
assert log.result == main(1000)
loop, = log.loops_by_filename(self.filepath)
> assert loop.match_by_id('pack_into', """\
dummy_get_utf8?
guard_not_invalidated(descr=...)
dummy_get_utf8?
_ = int_add(_, 1)
p68 = getfield_gc_r(p14, descr=<FieldP pypy.objspace.std.bytearrayobject.W_BytearrayObject.inst__data \d+>)
i69 = getfield_gc_i(p68, descr=<FieldS list.length \d+>)
i70 = getfield_gc_i(p14, descr=<FieldS pypy.objspace.std.bytearrayobject.W_BytearrayObject.inst__offset \d+>)
i71 = int_sub(i69, i70)
i72 = int_add(i71, -1)
i73 = int_add(i71, -5)
setfield_gc(p14, _, descr=<FieldS pypy.objspace.std.bytearrayobject.W_BytearrayObject.inst__exports \d+>)
i75 = int_lt(i73, 2)
guard_false(i75, descr=...)
i77 = int_le(i62, 32767)
guard_true(i77, descr=...)
p78 = getfield_gc_r(p68, descr=<FieldP list.items \d+>)
i81 = int_add(4, i70)
gc_store_indexed(p78, i81, i62, 1, _, 2, descr=<ArrayS 2>)
_ = getfield_gc_i(p14, descr=<FieldS pypy.objspace.std.bytearrayobject.W_BytearrayObject.inst__exports \d+>)
_ = int_le(_, 0)
guard_false(_, descr=...)
_ = int_add(_, -1)
""")
pypy/module/pypyjit/test_pypy_c/test_struct.py:194:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pypy/module/pypyjit/test_pypy_c/model.py:182: in match_by_id
return matcher.match(expected_src, ignore_ops=ignore_ops)
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 0x000000002f955248>
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 = 'pack_into'
('operation mismatch',)
<could not determine information>
Ignore ops: []
Got:
===== HERE =====
i77 = int_add(i68, 1)
p78 = getfield_gc_r(p12, descr=<FieldP pypy.objspace.std.bytearrayobject.W_BytearrayObject.inst__data 8>)
i79 = getfield_gc_i(p78, descr=<FieldS list.length 8>)
i80 = getfield_gc_i(p12, descr=<FieldS pypy.objspace.std.bytearrayobject.W_BytearrayObject.inst__offset 24>)
i81 = int_sub(i79, i80)
i83 = int_add(i81, -1)
i85 = int_add(i81, -5)
setfield_gc(p12, i77, descr=<FieldS pypy.objspace.std.bytearrayobject.W_BytearrayObject.inst__exports 16>)
i87 = int_lt(i85, 2)
guard_false(i87, descr=<Guard0xffffaa7a0da0>)
i89 = int_le(i70, 32767)
guard_true(i89, descr=<Guard0xffffaa7c0d40>)
p90 = getfield_gc_r(p78, descr=<FieldP list.items 16>)
i92 = int_add(4, i80)
gc_store_indexed(p90, i92, i70, 1, 16, 2, descr=<ArrayS 2>)
i96 = getfield_gc_i(p12, descr=<FieldS pypy.objspace.std.bytearrayobject.W_BytearrayObject.inst__exports 16>)
i98 = int_le(i96, 0)
guard_false(i98, descr=<Guard0xffffaa7a0de8>)
i100 = int_add(i96, -1)
Expected:
dummy_get_utf8?
guard_not_invalidated(descr=...)
dummy_get_utf8?
_ = int_add(_, 1)
p68 = getfield_gc_r(p14, descr=<FieldP pypy.objspace.std.bytearrayobject.W_BytearrayObject.inst__data \d+>)
i69 = getfield_gc_i(p68, descr=<FieldS list.length \d+>)
i70 = getfield_gc_i(p14, descr=<FieldS pypy.objspace.std.bytearrayobject.W_BytearrayObject.inst__offset \d+>)
i71 = int_sub(i69, i70)
i72 = int_add(i71, -1)
i73 = int_add(i71, -5)
setfield_gc(p14, _, descr=<FieldS pypy.objspace.std.bytearrayobject.W_BytearrayObject.inst__exports \d+>)
i75 = int_lt(i73, 2)
guard_false(i75, descr=...)
i77 = int_le(i62, 32767)
guard_true(i77, descr=...)
p78 = getfield_gc_r(p68, descr=<FieldP list.items \d+>)
i81 = int_add(4, i70)
gc_store_indexed(p78, i81, i62, 1, _, 2, descr=<ArrayS 2>)
_ = getfield_gc_i(p14, descr=<FieldS pypy.objspace.std.bytearrayobject.W_BytearrayObject.inst__exports \d+>)
_ = int_le(_, 0)
guard_false(_, descr=...)
_ = int_add(_, -1)
____________________________ TestThread.test_simple ____________________________
self = <pypy.module.pypyjit.test_pypy_c.test_thread.TestThread object at 0x000000002d316170>
def test_simple(self):
def main(n):
try:
import _thread as thread
except ImportError:
import thread
def f():
i = 0
while i < n:
i += 1
done.release()
done = thread.allocate_lock()
done.acquire()
thread.start_new_thread(f, ())
done.acquire()
return 0
log = self.run(main, [500])
assert round(log.result, 6) == round(main(500), 6)
loop, = log.loops_by_filename(self.filepath)
> assert loop.match("""
i2 = int_lt(i0, i1)
guard_true(i2, descr=...)
i3 = int_add(i0, 1)
--THREAD-TICK--
jump(..., descr=...)
""")
pypy/module/pypyjit/test_pypy_c/test_thread.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
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 0x000000002b214918>
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=<Guard0xffffa2928ba8>)
i34 = int_lt(i26, i23)
guard_true(i34, descr=<Guard0xffffa2937c10>)
i36 = int_add(i26, 1)
i38 = getfield_raw_i(281473492000456, descr=<FieldS pypysig_long_struct_inner.c_value 0>)
i40 = int_add(i38, -1)
setfield_raw(281473492000456, i40, descr=<FieldS pypysig_long_struct_inner.c_value 0>)
i43 = int_lt(i40, 0)
guard_false(i43, descr=<Guard0xffffa2928bf0>)
jump(p0, p1, i36, p10, p12, p20, i23, descr=TargetToken(281473409245856))
Expected:
i2 = int_lt(i0, i1)
guard_true(i2, descr=...)
i3 = int_add(i0, 1)
guard_not_invalidated?
ticker0 = getfield_raw_i(#, descr=<FieldS pypysig_long_struct_inner.c_value .*>)
ticker1 = int_add(ticker0, #)
setfield_raw(#, ticker1, descr=<FieldS pypysig_long_struct_inner.c_value .*>)
ticker_cond0 = int_lt(ticker1, 0)
guard_false(ticker_cond0, descr=...)
jump(..., descr=...)
_____________________________ TestThread.test_tls ______________________________
self = <pypy.module.pypyjit.test_pypy_c.test_thread.TestThread object at 0x000000002d5aafa8>
def test_tls(self):
def main(n):
try:
from _thread import _local
except ImportError:
from thread import _local
local = _local()
local.x = "abc" # prevent type unboxing
local.x = 1
i = 0
while i < n:
i += local.x
return 0
log = self.run(main, [500])
assert round(log.result, 6) == round(main(500), 6)
loop, = log.loops_by_filename(self.filepath)
> assert loop.match("""
i53 = int_lt(i48, i27)
guard_true(i53, descr=...)
i54 = int_add_ovf(i48, i47)
guard_no_overflow(descr=...)
--TICK--
i58 = arraylen_gc(p43, descr=...)
jump(..., descr=...)
""")
pypy/module/pypyjit/test_pypy_c/test_thread.py:49:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
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 0x000000002cca0a68>
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=<Guard0xffffb7da0c80>)
i54 = int_lt(i49, i28)
guard_true(i54, descr=<Guard0xffffb7dc2080>)
i55 = int_add_ovf(i49, i48)
guard_no_overflow(descr=<Guard0xffffb7dc20b0>)
i57 = getfield_raw_i(281473848516296, descr=<FieldS pypysig_long_struct_inner.c_value 0>)
i59 = int_lt(i57, 0)
guard_false(i59, descr=<Guard0xffffb7dc2110>)
i60 = arraylen_gc(p44, descr=<ArrayP 8>)
jump(p0, p1, p8, p10, p12, i55, p20, p22, i28, p36, p40, p44, p46, i48, descr=TargetToken(281473766253152))
Expected:
i53 = int_lt(i48, i27)
guard_true(i53, descr=...)
i54 = int_add_ovf(i48, i47)
guard_no_overflow(descr=...)
guard_not_invalidated?
ticker0 = getfield_raw_i(#, descr=<FieldS pypysig_long_struct_inner.c_value .*>)
ticker_cond0 = int_lt(ticker0, 0)
guard_false(ticker_cond0, descr=...)
i58 = arraylen_gc(p43, descr=...)
jump(..., descr=...)
_____________________ TestThread.test_lock_acquire_release _____________________
self = <pypy.module.pypyjit.test_pypy_c.test_thread.TestThread object at 0x000000002f9a0480>
def test_lock_acquire_release(self):
def main(n):
import threading
lock = threading.Lock()
while n > 0:
with lock:
n -= 1
log = self.run(main, [500])
assert log.result == main(500)
loop, = log.loops_by_filename(self.filepath)
> assert loop.match("""
i56 = int_gt(i44, 0)
guard_true(i56, descr=...)
guard_not_invalidated?
p57 = force_token()
setfield_gc(p0, p57, descr=<FieldP pypy.interpreter.pyframe.PyFrame.vable_token 8>)
i58 = call_may_force_i(ConstClass(acquire_timed), p31, -1, descr=<Calli . ri EF=7>)
guard_not_forced(descr=...)
guard_no_exception(descr=...)
i99 = int_eq(i58, 1)
guard_true(i99, descr=...)
i58 = int_add(i44, -1)
guard_not_invalidated?
i59 = call_i(ConstClass(RPyThreadReleaseLock), i37, descr=<Calli . i EF=2>)
i60 = int_is_true(i59)
guard_false(i60, descr=...)
--TICK--
jump(..., descr=...)
""")
pypy/module/pypyjit/test_pypy_c/test_thread.py:69:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
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 0x000000002c235440>
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=<Guard0xffffa7e67730>)
i50 = int_gt(i40, 0)
guard_true(i50, descr=<Guard0xffffa7d44830>)
p51 = force_token()
setfield_gc(p0, p51, descr=<FieldP pypy.interpreter.pyframe.PyFrame.vable_token 8>)
i54 = call_may_force_i(ConstClass(acquire_timed), p32, -1, descr=<Calli 8 ri EF=7>)
guard_not_forced(descr=<Guard0xffffa7e639c0>)
guard_no_exception(descr=<Guard0xffffa7d44860>)
i56 = int_eq(i54, 1)
guard_true(i56, descr=<Guard0xffffa7d448c0>)
guard_not_invalidated(descr=<Guard0xffffa7d448f0>)
i58 = int_add(i40, -1)
i60 = call_i(ConstClass(RPyThreadReleaseLock), i41, descr=<Calli 8 i EF=2>)
i61 = int_is_true(i60)
guard_false(i61, descr=<Guard0xffffa7e67778>)
i64 = getfield_raw_i(281473582177992, descr=<FieldS pypysig_long_struct_inner.c_value 0>)
i66 = int_lt(i64, 0)
guard_false(i66, descr=<Guard0xffffa7d44980>)
jump(p0, p1, i58, p10, p12, p22, p24, p32, i41, descr=TargetToken(281473497318816))
Expected:
i56 = int_gt(i44, 0)
guard_true(i56, descr=...)
guard_not_invalidated?
p57 = force_token()
setfield_gc(p0, p57, descr=<FieldP pypy.interpreter.pyframe.PyFrame.vable_token 8>)
i58 = call_may_force_i(ConstClass(acquire_timed), p31, -1, descr=<Calli . ri EF=7>)
guard_not_forced(descr=...)
guard_no_exception(descr=...)
i99 = int_eq(i58, 1)
guard_true(i99, descr=...)
i58 = int_add(i44, -1)
guard_not_invalidated?
i59 = call_i(ConstClass(RPyThreadReleaseLock), i37, descr=<Calli . i EF=2>)
i60 = int_is_true(i59)
guard_false(i60, descr=...)
guard_not_invalidated?
ticker0 = getfield_raw_i(#, descr=<FieldS pypysig_long_struct_inner.c_value .*>)
ticker_cond0 = int_lt(ticker0, 0)
guard_false(ticker_cond0, descr=...)
jump(..., descr=...)
____________________ TestThread.test_make_ref_with_callback ____________________
self = <pypy.module.pypyjit.test_pypy_c.test_weakref.TestThread object at 0x000000002a4fb558>
def test_make_ref_with_callback(self):
log = self.run("""
import weakref
class Dummy(object):
pass
def noop(obj):
pass
def main(n):
obj = Dummy()
for i in range(n):
weakref.ref(obj, noop)
""", [500])
loop, = log.loops_by_filename(self.filepath)
> assert loop.match("""
i58 = getfield_gc_i(p18, descr=<FieldS pypy.module.__builtin__.functional.W_IntRangeIterator.inst_current .>)
i60 = int_lt(i58, i31)
guard_true(i60, descr=...)
i61 = int_add(i58, 1)
dummy_get_utf8?
setfield_gc(p18, i61, descr=<FieldS pypy.module.__builtin__.functional.W_IntRangeIterator.inst_current 8>)
guard_not_invalidated(descr=...)
dummy_get_utf8?
dummy_get_utf8?
p65 = getfield_gc_r(p14, descr=<FieldP .+inst_map \d+>)
guard_value(p65, ConstPtr(ptr45), descr=...)
p66 = getfield_gc_r(p14, descr=<FieldP .+inst__value0 \d+>)
guard_nonnull(p66, descr=...)
p67 = force_token()
setfield_gc(p0, p67, descr=<FieldP pypy.interpreter.pyframe.PyFrame.vable_token \d+>)
p68 = call_may_force_r(ConstClass(WeakrefLifeline.make_weakref_with_callback), p66, ConstPtr(ptr50), p14, ConstPtr(ptr51), descr=<Callr \d rrrr EF=7>)
guard_not_forced(descr=...)
guard_no_exception(descr=...)
guard_nonnull_class(p68, ..., descr=...)
guard_not_invalidated(descr=...)
--TICK--
jump(..., descr=...)
""")
pypy/module/pypyjit/test_pypy_c/test_weakref.py:21:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
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 0x0000000030769520>
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=<Guard0xffffb3ff2e78>)
i45 = getfield_gc_i(p14, descr=<FieldS pypy.module.__builtin__.functional.W_IntRangeIterator.inst_current 8>)
i46 = int_lt(i45, i27)
guard_true(i46, descr=<Guard0xffffb4013b80>)
i48 = int_add(i45, 1)
p49 = getfield_gc_r(p10, descr=<FieldP pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable.inst_map 48>)
setfield_gc(p14, i48, descr=<FieldS pypy.module.__builtin__.functional.W_IntRangeIterator.inst_current 8>)
guard_value(p49, ConstPtr(ptr50), descr=<Guard0xffffb3ff2ec0>)
p52 = getfield_gc_r(p10, descr=<FieldP pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable.inst__value0 8>)
guard_nonnull(p52, descr=<Guard0xffffb4013be0>)
p53 = force_token()
setfield_gc(p0, p53, descr=<FieldP pypy.interpreter.pyframe.PyFrame.vable_token 8>)
p57 = call_may_force_r(ConstClass(WeakrefLifeline.make_weakref_with_callback), p52, ConstPtr(ptr55), p10, ConstPtr(ptr56), descr=<Callr 8 rrrr EF=7>)
guard_not_forced(descr=<Guard0xffffb3ffc2f0>)
guard_no_exception(descr=<Guard0xffffb4013c10>)
guard_nonnull_class(p57, 281473769502176, descr=<Guard0xffffb3ff2f08>)
guard_not_invalidated(descr=<Guard0xffffb4013c40>)
i60 = getfield_raw_i(281473783504584, descr=<FieldS pypysig_long_struct_inner.c_value 0>)
i62 = int_lt(i60, 0)
guard_false(i62, descr=<Guard0xffffb4013ca0>)
jump(p0, p1, p8, p10, i45, p14, i27, descr=TargetToken(281473701577504))
Expected:
i58 = getfield_gc_i(p18, descr=<FieldS pypy.module.__builtin__.functional.W_IntRangeIterator.inst_current .>)
i60 = int_lt(i58, i31)
guard_true(i60, descr=...)
i61 = int_add(i58, 1)
dummy_get_utf8?
setfield_gc(p18, i61, descr=<FieldS pypy.module.__builtin__.functional.W_IntRangeIterator.inst_current 8>)
guard_not_invalidated(descr=...)
dummy_get_utf8?
dummy_get_utf8?
p65 = getfield_gc_r(p14, descr=<FieldP .+inst_map \d+>)
guard_value(p65, ConstPtr(ptr45), descr=...)
p66 = getfield_gc_r(p14, descr=<FieldP .+inst__value0 \d+>)
guard_nonnull(p66, descr=...)
p67 = force_token()
setfield_gc(p0, p67, descr=<FieldP pypy.interpreter.pyframe.PyFrame.vable_token \d+>)
p68 = call_may_force_r(ConstClass(WeakrefLifeline.make_weakref_with_callback), p66, ConstPtr(ptr50), p14, ConstPtr(ptr51), descr=<Callr \d rrrr EF=7>)
guard_not_forced(descr=...)
guard_no_exception(descr=...)
guard_nonnull_class(p68, ..., descr=...)
guard_not_invalidated(descr=...)
guard_not_invalidated?
ticker0 = getfield_raw_i(#, descr=<FieldS pypysig_long_struct_inner.c_value .*>)
ticker_cond0 = int_lt(ticker0, 0)
guard_false(ticker_cond0, descr=...)
jump(..., descr=...)
=========================== short test summary info ============================
FAIL pypy/module/pypyjit/test_pypy_c/test_00_model.py::TestRunPyPyC::()::test_loops_by_id
FAIL pypy/module/pypyjit/test_pypy_c/test_00_model.py::TestRunPyPyC::()::test_ops_by_id
FAIL pypy/module/pypyjit/test_pypy_c/test_00_model.py::TestRunPyPyC::()::test_inlined_function
FAIL pypy/module/pypyjit/test_pypy_c/test_00_model.py::TestRunPyPyC::()::test_loop_match
FAIL pypy/module/pypyjit/test_pypy_c/test_array.py::TestArray::()::test_arraycopy_disappears
FAIL pypy/module/pypyjit/test_pypy_c/test_array.py::TestArray::()::test_array_intimg
FAIL pypy/module/pypyjit/test_pypy_c/test_buffers.py::TestBuffers::()::test_re_match
FAIL pypy/module/pypyjit/test_pypy_c/test_buffers.py::TestBuffers::()::test_struct_unpack
FAIL pypy/module/pypyjit/test_pypy_c/test_call.py::TestCall::()::test_simple_call
FAIL pypy/module/pypyjit/test_pypy_c/test_call.py::TestCall::()::test_method_call
FAIL pypy/module/pypyjit/test_pypy_c/test_call.py::TestCall::()::test_static_classmethod_call
FAIL pypy/module/pypyjit/test_pypy_c/test_call.py::TestCall::()::test_kwargs_empty
FAIL pypy/module/pypyjit/test_pypy_c/test_call.py::TestCall::()::test_func_defaults
FAIL pypy/module/pypyjit/test_pypy_c/test_call.py::TestCall::()::test_global_closure_has_constant_cells
FAIL pypy/module/pypyjit/test_pypy_c/test_call.py::TestCall::()::test_local_closure_is_virtual
FAIL pypy/module/pypyjit/test_pypy_c/test_call.py::TestCall::()::test_kwargs_virtual
FAIL pypy/module/pypyjit/test_pypy_c/test_call.py::TestCall::()::test_kwargs_virtual2
FAIL pypy/module/pypyjit/test_pypy_c/test_call.py::TestCall::()::test_kwargs_update_virtual1
FAIL pypy/module/pypyjit/test_pypy_c/test_call.py::TestCall::()::test_methodcall_kwargs_regression
FAIL pypy/module/pypyjit/test_pypy_c/test_exception.py::TestException::()::test_exception_inside_loop_1
FAIL pypy/module/pypyjit/test_pypy_c/test_exception.py::TestException::()::test_reraise
FAIL pypy/module/pypyjit/test_pypy_c/test_exception.py::TestException::()::test_continue_in_finally
FAIL pypy/module/pypyjit/test_pypy_c/test_ffi.py::Test__ffi::()::test_cffi_init_struct_with_list
FAIL pypy/module/pypyjit/test_pypy_c/test_generators.py::TestGenerators::()::test_simple_generator1
FAIL pypy/module/pypyjit/test_pypy_c/test_generators.py::TestGenerators::()::test_simple_generator2
FAIL pypy/module/pypyjit/test_pypy_c/test_getframe.py::TestGetFrame::()::test_getframe_one
FAIL pypy/module/pypyjit/test_pypy_c/test_globals.py::TestGlobals::()::test_load_builtin
FAIL pypy/module/pypyjit/test_pypy_c/test_import.py::TestImport::()::test_import_in_function
FAIL pypy/module/pypyjit/test_pypy_c/test_import.py::TestImport::()::test___import___has_fast_path
FAIL pypy/module/pypyjit/test_pypy_c/test_instance.py::TestInstance::()::test_virtual_instance
FAIL pypy/module/pypyjit/test_pypy_c/test_instance.py::TestInstance::()::test_load_attr
FAIL pypy/module/pypyjit/test_pypy_c/test_instance.py::TestInstance::()::test_mutate_class_int
FAIL pypy/module/pypyjit/test_pypy_c/test_instance.py::TestInstance::()::test_mutate_class
FAIL pypy/module/pypyjit/test_pypy_c/test_instance.py::TestInstance::()::test_python_contains
FAIL pypy/module/pypyjit/test_pypy_c/test_instance.py::TestInstance::()::test_super
FAIL pypy/module/pypyjit/test_pypy_c/test_instance.py::TestInstance::()::test_super_no_args
FAIL pypy/module/pypyjit/test_pypy_c/test_instance.py::TestInstance::()::test_float_instance_field_read
FAIL pypy/module/pypyjit/test_pypy_c/test_instance.py::TestInstance::()::test_float_instance_field_write
FAIL pypy/module/pypyjit/test_pypy_c/test_instance.py::TestInstance::()::test_namedtuple_construction
FAIL pypy/module/pypyjit/test_pypy_c/test_intbound.py::TestIntbound::()::test_intbound_gt
FAIL pypy/module/pypyjit/test_pypy_c/test_intbound.py::TestIntbound::()::test_intbound_sub_lt
FAIL pypy/module/pypyjit/test_pypy_c/test_intbound.py::TestIntbound::()::test_intbound_addsub_ge
FAIL pypy/module/pypyjit/test_pypy_c/test_intbound.py::TestIntbound::()::test_intbound_addmul_ge
FAIL pypy/module/pypyjit/test_pypy_c/test_intbound.py::TestIntbound::()::test_intbound_eq
FAIL pypy/module/pypyjit/test_pypy_c/test_intbound.py::TestIntbound::()::test_intbound_mul
FAIL pypy/module/pypyjit/test_pypy_c/test_intbound.py::TestIntbound::()::test_assert
FAIL pypy/module/pypyjit/test_pypy_c/test_intbound.py::TestIntbound::()::test_abs_branch_free
FAIL pypy/module/pypyjit/test_pypy_c/test_jitlogparser.py::TestLogParser::()::test
FAIL pypy/module/pypyjit/test_pypy_c/test_math.py::TestMath::()::test_log
FAIL pypy/module/pypyjit/test_pypy_c/test_math.py::TestMath::()::test_sin_cos
FAIL pypy/module/pypyjit/test_pypy_c/test_math.py::TestMath::()::test_pow_two
FAIL pypy/module/pypyjit/test_pypy_c/test_min_max.py::TestMinMax::()::test_min_max
FAIL pypy/module/pypyjit/test_pypy_c/test_misc.py::TestMisc::()::test_f1
FAIL pypy/module/pypyjit/test_pypy_c/test_misc.py::TestMisc::()::test_factorial
FAIL pypy/module/pypyjit/test_pypy_c/test_misc.py::TestMisc::()::test_mixed_type_loop
FAIL pypy/module/pypyjit/test_pypy_c/test_misc.py::TestMisc::()::test_cached_pure_func_of_equal_fields
FAIL pypy/module/pypyjit/test_pypy_c/test_misc.py::TestMisc::()::test_range_iter_simple
FAIL pypy/module/pypyjit/test_pypy_c/test_misc.py::TestMisc::()::test_range_iter_normal
FAIL pypy/module/pypyjit/test_pypy_c/test_misc.py::TestMisc::()::test_dont_trace_every_iteration
FAIL pypy/module/pypyjit/test_pypy_c/test_misc.py::TestMisc::()::test_locals
FAIL pypy/module/pypyjit/test_pypy_c/test_string.py::TestString::()::test_python3_missing_bchr
FAIL pypy/module/pypyjit/test_pypy_c/test_string.py::TestString::()::test_lookup_default_encoding
FAIL pypy/module/pypyjit/test_pypy_c/test_string.py::TestString::()::test_int_base_16
FAIL pypy/module/pypyjit/test_pypy_c/test_string.py::TestString::()::test_str_mod
FAIL pypy/module/pypyjit/test_pypy_c/test_string.py::TestString::()::test_lookup_codec
FAIL pypy/module/pypyjit/test_pypy_c/test_string.py::TestString::()::test_decode_ascii
FAIL pypy/module/pypyjit/test_pypy_c/test_string.py::TestString::()::test_unicode_indexing_small_constant_indices
FAIL pypy/module/pypyjit/test_pypy_c/test_struct.py::TestStruct::()::test_struct_function
FAIL pypy/module/pypyjit/test_pypy_c/test_struct.py::TestStruct::()::test_struct_object
FAIL pypy/module/pypyjit/test_pypy_c/test_struct.py::TestStruct::()::test_unpack_raw_buffer
FAIL pypy/module/pypyjit/test_pypy_c/test_struct.py::TestStruct::()::test_unpack_bytearray
FAIL pypy/module/pypyjit/test_pypy_c/test_struct.py::TestStruct::()::test_pack_into_raw_buffer
FAIL pypy/module/pypyjit/test_pypy_c/test_struct.py::TestStruct::()::test_pack_into_bytearray
FAIL pypy/module/pypyjit/test_pypy_c/test_thread.py::TestThread::()::test_simple
FAIL pypy/module/pypyjit/test_pypy_c/test_thread.py::TestThread::()::test_tls
FAIL pypy/module/pypyjit/test_pypy_c/test_thread.py::TestThread::()::test_lock_acquire_release
FAIL pypy/module/pypyjit/test_pypy_c/test_weakref.py::TestThread::()::test_make_ref_with_callback
======= 77 failed, 956 passed, 162 skipped, 1 xfailed in 232.03 seconds ========
program finished with exit code 1
elapsedTime=233.155543