jit/backend/x86/test/test_zrpy_releasegil.py::TestShadowStack::()::test_simple
cls = <class 'rpython.jit.backend.x86.test.test_zrpy_releasegil.TestShadowStack'>
def setup_class(cls):
funcs = []
name_to_func = {}
for fullname in dir(cls):
if not fullname.startswith('define'):
continue
definefunc = getattr(cls, fullname)
_, name = fullname.split('_', 1)
beforefunc, loopfunc, afterfunc = definefunc.im_func(cls)
if beforefunc is None:
def beforefunc(n, x):
return n, x, None, None, None, None, None, None, None, None, None, ''
if afterfunc is None:
def afterfunc(n, x, x0, x1, x2, x3, x4, x5, x6, x7, l, s):
pass
beforefunc.__name__ = 'before_'+name
loopfunc.__name__ = 'loop_'+name
afterfunc.__name__ = 'after_'+name
funcs.append((beforefunc, loopfunc, afterfunc))
assert name not in name_to_func
name_to_func[name] = len(name_to_func)
print(name_to_func)
def allfuncs(name, n):
x = X()
x.foo = 2
main_allfuncs(name, n, x)
x.foo = 5
return weakref.ref(x)
def main_allfuncs(name, n, x):
num = name_to_func[name]
n, x, x0, x1, x2, x3, x4, x5, x6, x7, l, s = funcs[num][0](n, x)
while n > 0:
myjitdriver.can_enter_jit(num=num, n=n, x=x, x0=x0, x1=x1,
x2=x2, x3=x3, x4=x4, x5=x5, x6=x6, x7=x7, l=l, s=s)
myjitdriver.jit_merge_point(num=num, n=n, x=x, x0=x0, x1=x1,
x2=x2, x3=x3, x4=x4, x5=x5, x6=x6, x7=x7, l=l, s=s)
n, x, x0, x1, x2, x3, x4, x5, x6, x7, l, s = funcs[num][1](
n, x, x0, x1, x2, x3, x4, x5, x6, x7, l, s)
funcs[num][2](n, x, x0, x1, x2, x3, x4, x5, x6, x7, l, s)
myjitdriver = JitDriver(greens = ['num'],
reds = ['n', 'x', 'x0', 'x1', 'x2', 'x3', 'x4',
'x5', 'x6', 'x7', 'l', 's'], is_recursive=True)
cls.main_allfuncs = staticmethod(main_allfuncs)
cls.name_to_func = name_to_func
OLD_DEBUG = GcLLDescr_framework.DEBUG
try:
GcLLDescr_framework.DEBUG = True
cls.cbuilder = compile(get_entry(allfuncs), cls.gc,
gcrootfinder=cls.gcrootfinder, jit=True,
> thread=True)
jit/backend/llsupport/test/zrpy_gc_test.py:187:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
jit/backend/llsupport/test/zrpy_gc_test.py:105: in compile
apply_jit(t)
jit/metainterp/warmspot.py:51: in apply_jit
**kwds)
jit/metainterp/warmspot.py:242: in __init__
self.build_cpu(CPUClass, **kwds)
jit/metainterp/warmspot.py:494: in build_cpu
translate_support_code, gcdescr=self.gcdescr)
jit/backend/x86/runner.py:43: in __init__
translate_support_code, gcdescr)
jit/backend/llsupport/llmodel.py:58: in __init__
self.gc_ll_descr = get_ll_description(gcdescr, translator, rtyper)
jit/backend/llsupport/gc.py:664: in get_ll_description
return cls(gcdescr, translator, rtyper)
jit/backend/llsupport/gc.py:334: in __init__
self._make_layoutbuilder()
jit/backend/llsupport/gc.py:373: in _make_layoutbuilder
self.layoutbuilder = framework.TransformerLayoutBuilder(translator)
memory/gctransform/framework.py:1679: in __init__
GCClass, _ = choose_gc_from_config(translator.config)
memory/gc/base.py:593: in choose_gc_from_config
globals(), locals(), [classname])
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
"""
# XXX Should find a way to bound the major collection threshold by the
# XXX total addressable size. Maybe by keeping some minimarkpage arenas
# XXX pre-reserved, enough for a few nursery collections? What about
# XXX raw-malloced memory?
# XXX try merging old_objects_pointing_to_pinned into
# XXX old_objects_pointing_to_young (IRC 2014-10-22, fijal and gregor_w)
import sys
import os
import time
from rpython.rtyper.lltypesystem import lltype, llmemory, llarena, llgroup
from rpython.rtyper.lltypesystem.lloperation import llop
from rpython.rtyper.lltypesystem.llmemory import raw_malloc_usage
from rpython.memory.gc.base import GCBase, MovingGCBase
> from rpython.memory.gc import env
E File "/build_dir/rpython-linux-x86-64/build/rpython/memory/gc/env.py", line 423
E SyntaxError: Non-ASCII character '\xe2' in file /build_dir/rpython-linux-x86-64/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details
memory/gc/incminimark.py:70: SyntaxError
---------- Captured stdout setup ----------
{'simple': 2, 'get_set_errno': 1, 'close_stack': 0}
---------- Captured stderr setup ----------
[rtyper] specializing: 100 / 1134 blocks (8%)
[rtyper] specializing: 200 / 1274 blocks (15%)
[rtyper] specializing: 300 / 1336 blocks (22%)
[rtyper] specializing: 400 / 1336 blocks (29%)
[rtyper] specializing: 500 / 1340 blocks (37%)
[rtyper] specializing: 600 / 1340 blocks (44%)
[rtyper] specializing: 700 / 1340 blocks (52%)
[rtyper] specializing: 800 / 1340 blocks (59%)
[rtyper] specializing: 900 / 1340 blocks (67%)
[rtyper] specializing: 1000 / 1340 blocks (74%)
[rtyper] specializing: 1100 / 1340 blocks (82%)
[rtyper] specializing: 1200 / 1340 blocks (89%)
[rtyper] specializing: 1300 / 1340 blocks (97%)
[rtyper] -=- specialized 1340 blocks -=-
[rtyper] -=- specialized 4 more blocks -=-
builder: rpython-linux-x86-64 build #898+
test: jit/backend/x86/test/test_zrpy_releasegil.py::TestShadowStack::()::test_simple