… | |
… | |
971 | static int |
971 | static int |
972 | runops_trace (pTHX) |
972 | runops_trace (pTHX) |
973 | { |
973 | { |
974 | COP *oldcop = 0; |
974 | COP *oldcop = 0; |
975 | int oldcxix = -2; |
975 | int oldcxix = -2; |
976 | struct coro *coro = SvSTATE_current; /* trace cctx is tied to specific coro */ |
|
|
977 | coro_cctx *cctx = coro->cctx; |
|
|
978 | |
976 | |
979 | while ((PL_op = CALL_FPTR (PL_op->op_ppaddr) (aTHX))) |
977 | while ((PL_op = CALL_FPTR (PL_op->op_ppaddr) (aTHX))) |
980 | { |
978 | { |
981 | PERL_ASYNC_CHECK (); |
979 | PERL_ASYNC_CHECK (); |
982 | |
980 | |
983 | if (cctx->flags & CC_TRACE_ALL) |
981 | if (cctx_current->flags & CC_TRACE_ALL) |
984 | { |
982 | { |
985 | if (PL_op->op_type == OP_LEAVESUB && cctx->flags & CC_TRACE_SUB) |
983 | if (PL_op->op_type == OP_LEAVESUB && cctx_current->flags & CC_TRACE_SUB) |
986 | { |
984 | { |
987 | PERL_CONTEXT *cx = &cxstack[cxstack_ix]; |
985 | PERL_CONTEXT *cx = &cxstack[cxstack_ix]; |
988 | SV **bot, **top; |
986 | SV **bot, **top; |
989 | AV *av = newAV (); /* return values */ |
987 | AV *av = newAV (); /* return values */ |
990 | SV **cb; |
988 | SV **cb; |
… | |
… | |
1027 | |
1025 | |
1028 | if (PL_curcop != &PL_compiling) |
1026 | if (PL_curcop != &PL_compiling) |
1029 | { |
1027 | { |
1030 | SV **cb; |
1028 | SV **cb; |
1031 | |
1029 | |
1032 | if (oldcxix != cxstack_ix && cctx->flags & CC_TRACE_SUB) |
1030 | if (oldcxix != cxstack_ix && cctx_current->flags & CC_TRACE_SUB) |
1033 | { |
1031 | { |
1034 | PERL_CONTEXT *cx = &cxstack[cxstack_ix]; |
1032 | PERL_CONTEXT *cx = &cxstack[cxstack_ix]; |
1035 | |
1033 | |
1036 | if (CxTYPE (cx) == CXt_SUB && oldcxix < cxstack_ix) |
1034 | if (CxTYPE (cx) == CXt_SUB && oldcxix < cxstack_ix) |
1037 | { |
1035 | { |
… | |
… | |
1060 | } |
1058 | } |
1061 | |
1059 | |
1062 | oldcxix = cxstack_ix; |
1060 | oldcxix = cxstack_ix; |
1063 | } |
1061 | } |
1064 | |
1062 | |
1065 | if (cctx->flags & CC_TRACE_LINE) |
1063 | if (cctx_current->flags & CC_TRACE_LINE) |
1066 | { |
1064 | { |
1067 | dSP; |
1065 | dSP; |
1068 | |
1066 | |
1069 | PL_runops = RUNOPS_DEFAULT; |
1067 | PL_runops = RUNOPS_DEFAULT; |
1070 | ENTER; |
1068 | ENTER; |
… | |
… | |
3032 | |
3030 | |
3033 | SV * |
3031 | SV * |
3034 | has_cctx (Coro::State coro) |
3032 | has_cctx (Coro::State coro) |
3035 | PROTOTYPE: $ |
3033 | PROTOTYPE: $ |
3036 | CODE: |
3034 | CODE: |
3037 | RETVAL = boolSV (!!coro->cctx); |
3035 | /* maybe manage the running flag differently */ |
|
|
3036 | RETVAL = boolSV (!!coro->cctx || (coro->flags & CF_RUNNING)); |
3038 | OUTPUT: |
3037 | OUTPUT: |
3039 | RETVAL |
3038 | RETVAL |
3040 | |
3039 | |
3041 | int |
3040 | int |
3042 | is_traced (Coro::State coro) |
3041 | is_traced (Coro::State coro) |
… | |
… | |
3062 | |
3061 | |
3063 | void |
3062 | void |
3064 | force_cctx () |
3063 | force_cctx () |
3065 | PROTOTYPE: |
3064 | PROTOTYPE: |
3066 | CODE: |
3065 | CODE: |
3067 | SvSTATE_current->cctx->idle_sp = 0; |
3066 | cctx_current->idle_sp = 0; |
3068 | |
3067 | |
3069 | void |
3068 | void |
3070 | swap_defsv (Coro::State self) |
3069 | swap_defsv (Coro::State self) |
3071 | PROTOTYPE: $ |
3070 | PROTOTYPE: $ |
3072 | ALIAS: |
3071 | ALIAS: |