Ejemplo n.º 1
0
 def driver():
     bench = Benchmark()
     while 1:
         res = interp(code, 0, 2500)
         if bench.stop():
             break
     return res
Ejemplo n.º 2
0
 def driver():
     bench = Benchmark()
     while 1:
         res = interp(code, 0, 2500)
         if bench.stop():
             break
     return res
Ejemplo n.º 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
Ejemplo n.º 4
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
Ejemplo n.º 5
0
 def main(num, arg):
     return interp(codes[num], inputarg=arg)
Ejemplo n.º 6
0
 def main(num, arg):
     return interp(codes[num], inputarg=arg)