| 1 |
from rpython.jit.backend.llsupport.test.zrpy_gc_test import compile |
| 2 |
from rpython.rlib.jit import JitDriver, set_param |
| 3 |
|
| 4 |
|
| 5 |
def compile(f, gc, **kwds): |
| 6 |
from rpython.annotator.listdef import s_list_of_strings |
| 7 |
from rpython.translator.translator import TranslationContext |
| 8 |
from rpython.jit.metainterp.warmspot import apply_jit |
| 9 |
from rpython.translator.c import genc |
| 10 |
|
| 11 |
t = TranslationContext() |
| 12 |
t.config.translation.gc = 'boehm' |
| 13 |
for name, value in kwds.items(): |
| 14 |
setattr(t.config.translation, name, value) |
| 15 |
ann = t.buildannotator() |
| 16 |
ann.build_types(f, [s_list_of_strings], main_entry_point=True) |
| 17 |
t.buildrtyper().specialize() |
| 18 |
|
| 19 |
if kwds['jit']: |
| 20 |
apply_jit(t, vec=True) |
| 21 |
|
| 22 |
class TestVecOptX86(object): |
| 23 |
def test_translate(self): |
| 24 |
jd = JitDriver(greens = [], reds = 'auto', vectorize=True) |
| 25 |
def f(x): |
| 26 |
pass |
| 27 |
i = 0 |
| 28 |
while i < 100: |
| 29 |
jd.jit_merge_point() |
| 30 |
i += 1 |
| 31 |
compile(f, 'boehm', jit=True) |
| 32 |
|