… | |
… | |
56 | |
56 | |
57 | /* optionally saved, might be zero */ |
57 | /* optionally saved, might be zero */ |
58 | AV *defav; |
58 | AV *defav; |
59 | SV *defsv; |
59 | SV *defsv; |
60 | SV *errsv; |
60 | SV *errsv; |
61 | /* TODO: PL_pmop might be nice && effortless to save. */ |
|
|
62 | |
61 | |
63 | /* saved global state not related to stacks */ |
62 | /* saved global state not related to stacks */ |
64 | U8 dowarn; |
63 | U8 dowarn; |
65 | I32 in_eval; |
64 | I32 in_eval; |
66 | |
65 | |
… | |
… | |
69 | AV *curstack; |
68 | AV *curstack; |
70 | AV *mainstack; |
69 | AV *mainstack; |
71 | SV **stack_sp; |
70 | SV **stack_sp; |
72 | OP *op; |
71 | OP *op; |
73 | SV **curpad; |
72 | SV **curpad; |
|
|
73 | AV *comppad; |
74 | SV **stack_base; |
74 | SV **stack_base; |
75 | SV **stack_max; |
75 | SV **stack_max; |
76 | SV **tmps_stack; |
76 | SV **tmps_stack; |
77 | I32 tmps_floor; |
77 | I32 tmps_floor; |
78 | I32 tmps_ix; |
78 | I32 tmps_ix; |
… | |
… | |
291 | PL_curstack = c->curstack; |
291 | PL_curstack = c->curstack; |
292 | PL_mainstack = c->mainstack; |
292 | PL_mainstack = c->mainstack; |
293 | PL_stack_sp = c->stack_sp; |
293 | PL_stack_sp = c->stack_sp; |
294 | PL_op = c->op; |
294 | PL_op = c->op; |
295 | PL_curpad = c->curpad; |
295 | PL_curpad = c->curpad; |
|
|
296 | PL_comppad = c->comppad; |
296 | PL_stack_base = c->stack_base; |
297 | PL_stack_base = c->stack_base; |
297 | PL_stack_max = c->stack_max; |
298 | PL_stack_max = c->stack_max; |
298 | PL_tmps_stack = c->tmps_stack; |
299 | PL_tmps_stack = c->tmps_stack; |
299 | PL_tmps_floor = c->tmps_floor; |
300 | PL_tmps_floor = c->tmps_floor; |
300 | PL_tmps_ix = c->tmps_ix; |
301 | PL_tmps_ix = c->tmps_ix; |
… | |
… | |
420 | c->curstack = PL_curstack; |
421 | c->curstack = PL_curstack; |
421 | c->mainstack = PL_mainstack; |
422 | c->mainstack = PL_mainstack; |
422 | c->stack_sp = PL_stack_sp; |
423 | c->stack_sp = PL_stack_sp; |
423 | c->op = PL_op; |
424 | c->op = PL_op; |
424 | c->curpad = PL_curpad; |
425 | c->curpad = PL_curpad; |
|
|
426 | c->comppad = PL_comppad; |
425 | c->stack_base = PL_stack_base; |
427 | c->stack_base = PL_stack_base; |
426 | c->stack_max = PL_stack_max; |
428 | c->stack_max = PL_stack_max; |
427 | c->tmps_stack = PL_tmps_stack; |
429 | c->tmps_stack = PL_tmps_stack; |
428 | c->tmps_floor = PL_tmps_floor; |
430 | c->tmps_floor = PL_tmps_floor; |
429 | c->tmps_ix = PL_tmps_ix; |
431 | c->tmps_ix = PL_tmps_ix; |
… | |
… | |
638 | * that doesn't matter, though, since it is only |
640 | * that doesn't matter, though, since it is only |
639 | * pp_nextstate and we never return... |
641 | * pp_nextstate and we never return... |
640 | * ah yes, and I don't care anyways ;) |
642 | * ah yes, and I don't care anyways ;) |
641 | */ |
643 | */ |
642 | PUTBACK; |
644 | PUTBACK; |
643 | PL_op = pp_entersub(); |
645 | PL_op = PL_ppaddr[OP_ENTERSUB](aTHX); |
644 | SPAGAIN; |
646 | SPAGAIN; |
645 | |
647 | |
646 | ENTER; /* necessary e.g. for dounwind */ |
648 | ENTER; /* necessary e.g. for dounwind */ |
647 | } |
649 | } |
648 | } |
650 | } |
… | |
… | |
749 | setup_coro (next); |
751 | setup_coro (next); |
750 | } |
752 | } |
751 | |
753 | |
752 | /* |
754 | /* |
753 | * xnext is now either prev or next, depending on wether |
755 | * xnext is now either prev or next, depending on wether |
754 | * we switched the c stack or not. that's why i use a global |
756 | * we switched the c stack or not. that's why I use a global |
755 | * variable, that should become thread-specific at one point. |
757 | * variable, that should become thread-specific at one point. |
756 | */ |
758 | */ |
757 | xnext->cursp = stacklevel; |
759 | xnext->cursp = stacklevel; |
758 | } |
760 | } |
759 | |
761 | |
… | |
… | |
868 | next = coro_deq (PRIO_MIN); |
870 | next = coro_deq (PRIO_MIN); |
869 | |
871 | |
870 | if (!next) |
872 | if (!next) |
871 | next = SvREFCNT_inc (SvRV (GvSV (coro_idle))); |
873 | next = SvREFCNT_inc (SvRV (GvSV (coro_idle))); |
872 | |
874 | |
|
|
875 | /* free this only after the transfer */ |
873 | coro_mortal = prev; |
876 | coro_mortal = prev; |
874 | SV_CORO (prev, "Coro::schedule"); |
877 | SV_CORO (prev, "Coro::schedule"); |
875 | |
878 | |
876 | SvRV (GvSV (coro_current)) = next; |
879 | SvRV (GvSV (coro_current)) = next; |
877 | |
880 | |