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