예제 #1
0
파일: test_tl.py 프로젝트: chyyuu/pygirl
 def driver():
     bench = Benchmark()
     while 1:
         res = interp(code, 0, 2500)
         if bench.stop():
             break
     return res
예제 #2
0
 def driver():
     bench = Benchmark()
     while 1:
         res = interp(code, 0, 2500)
         if bench.stop():
             break
     return res
예제 #3
0
    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
예제 #4
0
파일: test_tl.py 프로젝트: alkorzt/pypy
    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
예제 #5
0
 def main(num, arg):
     return interp(codes[num], inputarg=arg)
예제 #6
0
 def main(num, arg):
     return interp(codes[num], inputarg=arg)