Beispiel #1
0
 def driver():
     bench = Benchmark()
     while 1:
         res = interp(code, 0, 2500)
         if bench.stop():
             break
     return res
Beispiel #2
0
 def driver():
     bench = Benchmark()
     while 1:
         res = interp(code, 0, 2500)
         if bench.stop():
             break
     return res
Beispiel #3
0
    def test_tl_call(self, listops=True, policy=None):
        from rpython.jit.tl.tl import interp
        from rpython.jit.tl.tlopcode import compile

        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], enable_opts='',
                               listops=listops, backendopt=True, policy=policy)
        assert res == 0
Beispiel #4
0
 def main(num, arg):
     return interp(codes[num], inputarg=arg)