def driver(): bench = Benchmark() while 1: res = interp(code, 0, 2500) if bench.stop(): break return res
def test_tl_call(self, listops=True, policy=None): from pypy.jit.tl.tl import interp from pypy.jit.tl.tlopcode import compile from pypy.jit.metainterp import simple_optimize code = compile(''' PUSHARG start: PUSH 1 SUB PICK 0 PUSH 0 CALL func POP GT BR_COND start exit: RETURN func: PUSH 0 inside: PUSH 1 ADD PICK 0 PUSH 5 LE BR_COND inside PUSH 1 RETURN ''') assert interp(code, inputarg=100) == 0 codes = [code, ''] def main(num, arg): return interp(codes[num], inputarg=arg) res = self.meta_interp(main, [0, 20], optimizer=OPTIMIZER_SIMPLE, listops=listops, backendopt=True, policy=policy) assert res == 0
def main(num, arg): return interp(codes[num], inputarg=arg)