Exemple #1
0
 def f():
     rstack.stack_frames_depth()
     rstack.set_stack_depth_limit(1)
     try:
         return g()
     except RuntimeError:
         return -123
Exemple #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
Exemple #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
Exemple #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
Exemple #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
Exemple #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
Exemple #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
Exemple #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
Exemple #9
0
 def f(n):
     g1()
     if n > 0:
         res = f(n-1) + 0
     else:
         res = rstack.stack_frames_depth()
     g2(g1)
     return res
Exemple #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)
 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)
Exemple #13
0
 def h():
     x = rstack.stack_frames_depth()
     x += 1      # don't remove! otherwise it becomes a tail call
     x -= 1
     return x
Exemple #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
Exemple #15
0
 def g():
     return rstack.stack_frames_depth()
Exemple #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
Exemple #17
0
 def entrypoint():
     base = rstack.stack_frames_depth()
     return loop(base, 5) - 6
Exemple #18
0
 def f(n):
     if n > 0:
         res = f(n-1)
     else:
         res = rstack.stack_frames_depth()
     return res
Exemple #19
0
 def g(base):
     print rstack.stack_frames_depth()
     return rstack.stack_frames_depth() - base
Exemple #20
0
 def f():
     return stack_frames_depth()
Exemple #21
0
 def fn():
     base = rstack.stack_frames_depth()
     print base
     base = rstack.stack_frames_depth()
     print base
     return g(base) + 100
Exemple #22
0
 def f():
     return stack_frames_depth()
Exemple #23
0
def ll_stackless_stack_frames_depth():
    return rstack.stack_frames_depth()