Exemplo n.º 1
0
        def main(n):
            import pypyjit

            f = lambda: None
            tup = (n, n)
            while n > 0:
                tup[0]  # ID: getitem
                pypyjit.residual_call(f)
                n -= 1
Exemplo n.º 2
0
        def main(n):
            import pypyjit

            f = lambda: None
            tup = (n, n)
            while n > 0:
                tup[0]  # ID: getitem
                pypyjit.residual_call(f)
                n -= 1
Exemplo n.º 3
0
 def main(n):
     from pypyjit import residual_call
     i = 0
     while i < n:
         try:
             residual_call(len, [])   # ID: call
         except:
             pass
         i += 1
     return i
Exemplo n.º 4
0
 def main(n):
     from pypyjit import residual_call
     l = len
     i = 0
     while i < n:
         try:
             residual_call(l, [])  # ID: call
         except:
             pass
         i += 1
     return i
Exemplo n.º 5
0
    def test_interface_residual_call(self):
        import pypyjit

        def f(*args, **kwds):
            return (args, kwds)

        res = pypyjit.residual_call(f, 4, x=6)
        assert res == ((4, ), {'x': 6})
Exemplo n.º 6
0
        def main(n):
            import pypyjit

            i = 0
            while i < n:
                l = len # ID: loadglobal
                i += pypyjit.residual_call(l, "a")
            return i
Exemplo n.º 7
0
 def test_interface_residual_call(self):
     import pypyjit
     def f(*args, **kwds):
         return (args, kwds)
     res = pypyjit.residual_call(f, 4, x=6)
     assert res == ((4,), {'x': 6})