ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Coro/Coro/State.xs
(Generate patch)

Comparing Coro/Coro/State.xs (file contents):
Revision 1.322 by root, Sat Nov 22 05:13:34 2008 UTC vs.
Revision 1.323 by root, Sat Nov 22 06:03:10 2008 UTC

971static int 971static int
972runops_trace (pTHX) 972runops_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
3033SV * 3031SV *
3034has_cctx (Coro::State coro) 3032has_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
3041int 3040int
3042is_traced (Coro::State coro) 3041is_traced (Coro::State coro)
3062 3061
3063void 3062void
3064force_cctx () 3063force_cctx ()
3065 PROTOTYPE: 3064 PROTOTYPE:
3066 CODE: 3065 CODE:
3067 SvSTATE_current->cctx->idle_sp = 0; 3066 cctx_current->idle_sp = 0;
3068 3067
3069void 3068void
3070swap_defsv (Coro::State self) 3069swap_defsv (Coro::State self)
3071 PROTOTYPE: $ 3070 PROTOTYPE: $
3072 ALIAS: 3071 ALIAS:

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines