Beispiel #1
0
def slp_main_loop(depth):
    """
    slp_main_loop() keeps resuming...
    """
    while True:
        pending = global_state.top
        pending.f_depth = depth  # this starts after the first Unwind
        if pending.f_depth > global_state.stack_depth_limit:
            # uncommon case: exceed the limit
            pending = pending.f_back
            pending.f_depth = depth - 1
            e = RuntimeError()
            if not pending:
                raise e
            global_state.exception = e
            global_state.top = pending

        while True:
            prevdepth = pending.f_depth - 1
            back = pending.f_back
            decoded = frame.decodestate(pending.f_restart)
            (fn, global_state.restart_substate, signature_index) = decoded
            try:
                call_function(fn, signature_index)
            except UnwindException, u:  #XXX annotation support needed
                u.frame_bottom.f_back = back
                depth = prevdepth + u.depth
                break
            except SwitchException:
                pending = global_state.top
                continue
            except Exception, e:
                if not back:
                    raise
                global_state.exception = e
Beispiel #2
0
def slp_main_loop(depth):
    """
    slp_main_loop() keeps resuming...
    """
    while True:
        pending = global_state.top
        pending.f_depth = depth        # this starts after the first Unwind
        if pending.f_depth > global_state.stack_depth_limit:
            # uncommon case: exceed the limit
            pending = pending.f_back
            pending.f_depth = depth - 1
            e = rstackovf._StackOverflow()
            if not pending:
                raise e
            global_state.exception = e
            global_state.top = pending

        while True:
            prevdepth = pending.f_depth - 1
            back = pending.f_back
            decoded = frame.decodestate(pending.f_restart)
            (fn, global_state.restart_substate, signature_index) = decoded
            try:
                call_function(fn, signature_index)
            except UnwindException, u:   #XXX annotation support needed
                u.frame_bottom.f_back = back
                depth = prevdepth + u.depth
                break
            except SwitchException:
                pending = global_state.top
                continue
            except Exception, e:
                if not back:
                    raise
                global_state.exception = e
Beispiel #3
0
def slp_main_loop():
    """
    slp_main_loop() keeps resuming...
    """
    pending = global_state.top
    
    while True:
        back = pending.f_back
        decoded = frame.decodestate(pending.f_restart)
        (fn, global_state.restart_substate, signature_index) = decoded
        try:
            call_function(fn, signature_index)
        except UnwindException, u:   #XXX annotation support needed
            if u.frame_bottom:
                u.frame_bottom.f_back = back
            pending = global_state.top
            continue
        except Exception, e:
            if not back:
                raise
            global_state.exception = e
Beispiel #4
0
def slp_main_loop():
    """
    slp_main_loop() keeps resuming...
    """
    pending = global_state.top

    while True:
        back = pending.f_back
        decoded = frame.decodestate(pending.f_restart)
        (fn, global_state.restart_substate, signature_index) = decoded
        try:
            call_function(fn, signature_index)
        except UnwindException, u:  # XXX annotation support needed
            if u.frame_bottom:
                u.frame_bottom.f_back = back
            pending = global_state.top
            continue
        except Exception, e:
            if not back:
                raise
            global_state.exception = e