예제 #1
0
 def f():
     rstack.stack_frames_depth()
     rstack.set_stack_depth_limit(1)
     try:
         return g()
     except RuntimeError:
         return -123
예제 #2
0
 def f(n):
     if n > 0:
         stack_frames_depth()
         res, dummy = f(n - 1)
     else:
         res, dummy = stack_frames_depth(), 1
     return res, dummy
예제 #3
0
 def f(n):
     if n > 0:
         stack_frames_depth()
         res, dummy = f(n-1)
     else:
         res, dummy = stack_frames_depth(), 1
     return res, dummy
예제 #4
0
 def g(base, lst):
     lst.append(rstack.stack_frames_depth() - base)
     #print lst
     frametop_before_5 = rstack.yield_current_frame_to_caller()
     lst.append(h())
     frametop_before_7 = frametop_before_5.switch()
     lst.append(rstack.stack_frames_depth())
     return frametop_before_7
예제 #5
0
 def f(base):
     lst = [rstack.stack_frames_depth() - base]
     #print lst
     frametop_before_4 = g(base, lst)
     lst.append(rstack.stack_frames_depth() - base)
     #print lst
     frametop_before_6 = frametop_before_4.switch()
     lst.append(h() - base)
     frametop_after_return = frametop_before_6.switch()
     lst.append(rstack.stack_frames_depth() - base)
     assert not frametop_after_return
     n = 0
     for i in lst:
         n = n*10 + i
     return n
예제 #6
0
 def f(n):
     if n > 0:
         res, dummy = f(n-1)
         return (res, dummy)
     else:
         res = rstack.stack_frames_depth(), 1
     return res
예제 #7
0
 def f(n, d, t):
     if n > 0:
         res, y, z = f(n-1, d, t)
         return res, y, z
     else:
         res = rstack.stack_frames_depth(), d, t
     return res
예제 #8
0
 def f(n):
     g1()
     if n > 0:
         res = f(n - 1) + 0  # make sure it is not a tail call
     else:
         res = stack_frames_depth()
     g2(g1)
     return res
예제 #9
0
 def f(n):
     g1()
     if n > 0:
         res = f(n-1) + 0
     else:
         res = rstack.stack_frames_depth()
     g2(g1)
     return res
예제 #10
0
 def f(n):
     g1()
     if n > 0:
         res = f(n-1) + 0 # make sure it is not a tail call
     else:
         res = stack_frames_depth()
     g2(g1)
     return res
 def f(coro, n, x):
     if n == 0:
         coro.switch()
         rstack.resume_point("f_0")
         assert rstack.stack_frames_depth() == 9
         return
     f(coro, n - 1, 2 * x)
     rstack.resume_point("f_1", coro, n, x)
     output.append(x)
예제 #12
0
 def f(coro, n, x):
     if n == 0:
         coro.switch()
         rstack.resume_point("f_0")
         assert rstack.stack_frames_depth() == 9
         return
     f(coro, n-1, 2*x)
     rstack.resume_point("f_1", coro, n, x)
     output.append(x)
예제 #13
0
 def h():
     x = rstack.stack_frames_depth()
     x += 1      # don't remove! otherwise it becomes a tail call
     x -= 1
     return x
예제 #14
0
 def f(n, d, t):
     if n > 0:
         a, b, c = f(n-1, d, t)
     else:
         a, b, c = stack_frames_depth(), d, t
     return a, b, c
예제 #15
0
 def g():
     return rstack.stack_frames_depth()
예제 #16
0
 def f(n, d, t):
     if n > 0:
         a, b, c = f(n - 1, d, t)
     else:
         a, b, c = stack_frames_depth(), d, t
     return a, b, c
예제 #17
0
 def entrypoint():
     base = rstack.stack_frames_depth()
     return loop(base, 5) - 6
예제 #18
0
 def f(n):
     if n > 0:
         res = f(n-1)
     else:
         res = rstack.stack_frames_depth()
     return res
예제 #19
0
 def g(base):
     print rstack.stack_frames_depth()
     return rstack.stack_frames_depth() - base
예제 #20
0
파일: test_stack.py 프로젝트: alkorzt/pypy
 def f():
     return stack_frames_depth()
예제 #21
0
 def fn():
     base = rstack.stack_frames_depth()
     print base
     base = rstack.stack_frames_depth()
     print base
     return g(base) + 100
예제 #22
0
 def f():
     return stack_frames_depth()
예제 #23
0
def ll_stackless_stack_frames_depth():
    return rstack.stack_frames_depth()