예제 #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
예제 #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
예제 #3
0
파일: test_call.py 프로젝트: ieure/pypy
 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
예제 #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
예제 #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})
예제 #6
0
        def main(n):
            import pypyjit

            i = 0
            while i < n:
                l = len # ID: loadglobal
                i += pypyjit.residual_call(l, "a")
            return i
예제 #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})