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