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.326 by root, Mon Nov 24 04:56:38 2008 UTC vs.
Revision 1.327 by root, Mon Nov 24 06:07:16 2008 UTC

247{ 247{
248 SV *defsv; 248 SV *defsv;
249 AV *defav; 249 AV *defav;
250 SV *errsv; 250 SV *errsv;
251 SV *irsgv; 251 SV *irsgv;
252 HV *hinthv;
252#define VAR(name,type) type name; 253#define VAR(name,type) type name;
253# include "state.h" 254# include "state.h"
254#undef VAR 255#undef VAR
255} perl_slots; 256} perl_slots;
256 257
517 perl_slots *slot = c->slot; 518 perl_slots *slot = c->slot;
518 c->slot = 0; 519 c->slot = 0;
519 520
520 PL_mainstack = c->mainstack; 521 PL_mainstack = c->mainstack;
521 522
522 GvSV (PL_defgv) = slot->defsv; 523 GvSV (PL_defgv) = slot->defsv;
523 GvAV (PL_defgv) = slot->defav; 524 GvAV (PL_defgv) = slot->defav;
524 GvSV (PL_errgv) = slot->errsv; 525 GvSV (PL_errgv) = slot->errsv;
525 GvSV (irsgv) = slot->irsgv; 526 GvSV (irsgv) = slot->irsgv;
527 GvHV (PL_hintgv) = slot->hinthv;
526 528
527 #define VAR(name,type) PL_ ## name = slot->name; 529 #define VAR(name,type) PL_ ## name = slot->name;
528 # include "state.h" 530 # include "state.h"
529 #undef VAR 531 #undef VAR
530 532
616 c->mainstack = PL_mainstack; 618 c->mainstack = PL_mainstack;
617 619
618 { 620 {
619 perl_slots *slot = c->slot = (perl_slots *)(cxstack + cxstack_ix + 1); 621 perl_slots *slot = c->slot = (perl_slots *)(cxstack + cxstack_ix + 1);
620 622
621 slot->defav = GvAV (PL_defgv); 623 slot->defav = GvAV (PL_defgv);
622 slot->defsv = DEFSV; 624 slot->defsv = DEFSV;
623 slot->errsv = ERRSV; 625 slot->errsv = ERRSV;
624 slot->irsgv = GvSV (irsgv); 626 slot->irsgv = GvSV (irsgv);
627 slot->hinthv = GvHV (PL_hintgv);
625 628
626 #define VAR(name,type) slot->name = PL_ ## name; 629 #define VAR(name,type) slot->name = PL_ ## name;
627 # include "state.h" 630 # include "state.h"
628 #undef VAR 631 #undef VAR
629 } 632 }
865 868
866 PL_runops = RUNOPS_DEFAULT; 869 PL_runops = RUNOPS_DEFAULT;
867 PL_curcop = &PL_compiling; 870 PL_curcop = &PL_compiling;
868 PL_in_eval = EVAL_NULL; 871 PL_in_eval = EVAL_NULL;
869 PL_comppad = 0; 872 PL_comppad = 0;
873 PL_comppad_name = 0;
874 PL_comppad_name_fill = 0;
875 PL_comppad_name_floor = 0;
870 PL_curpm = 0; 876 PL_curpm = 0;
871 PL_curpad = 0; 877 PL_curpad = 0;
872 PL_localizing = 0; 878 PL_localizing = 0;
873 PL_dirty = 0; 879 PL_dirty = 0;
874 PL_restartop = 0; 880 PL_restartop = 0;
875#if PERL_VERSION_ATLEAST (5,10,0) 881#if PERL_VERSION_ATLEAST (5,10,0)
876 PL_parser = 0; 882 PL_parser = 0;
877#endif 883#endif
884 PL_hints = 0;
878 885
879 /* recreate the die/warn hooks */ 886 /* recreate the die/warn hooks */
880 PL_diehook = 0; SvSetMagicSV (*hv_fetch (hv_sig, "__DIE__" , sizeof ("__DIE__" ) - 1, 1), rv_diehook ); 887 PL_diehook = 0; SvSetMagicSV (*hv_fetch (hv_sig, "__DIE__" , sizeof ("__DIE__" ) - 1, 1), rv_diehook );
881 PL_warnhook = 0; SvSetMagicSV (*hv_fetch (hv_sig, "__WARN__", sizeof ("__WARN__") - 1, 1), rv_warnhook); 888 PL_warnhook = 0; SvSetMagicSV (*hv_fetch (hv_sig, "__WARN__", sizeof ("__WARN__") - 1, 1), rv_warnhook);
882 889
883 GvSV (PL_defgv) = newSV (0); 890 GvSV (PL_defgv) = newSV (0);
884 GvAV (PL_defgv) = coro->args; coro->args = 0; 891 GvAV (PL_defgv) = coro->args; coro->args = 0;
885 GvSV (PL_errgv) = newSV (0); 892 GvSV (PL_errgv) = newSV (0);
886 GvSV (irsgv) = newSVpvn ("\n", 1); sv_magic (GvSV (irsgv), (SV *)irsgv, PERL_MAGIC_sv, "/", 0); 893 GvSV (irsgv) = newSVpvn ("\n", 1); sv_magic (GvSV (irsgv), (SV *)irsgv, PERL_MAGIC_sv, "/", 0);
894 GvHV (PL_hintgv) = 0;
887 PL_rs = newSVsv (GvSV (irsgv)); 895 PL_rs = newSVsv (GvSV (irsgv));
888 PL_defoutgv = (GV *)SvREFCNT_inc_NN (stdoutgv); 896 PL_defoutgv = (GV *)SvREFCNT_inc_NN (stdoutgv);
889 897
890 { 898 {
891 dSP; 899 dSP;
945 SvREFCNT_dec (GvAV (PL_defgv)); 953 SvREFCNT_dec (GvAV (PL_defgv));
946 SvREFCNT_dec (GvSV (PL_errgv)); 954 SvREFCNT_dec (GvSV (PL_errgv));
947 SvREFCNT_dec (PL_defoutgv); 955 SvREFCNT_dec (PL_defoutgv);
948 SvREFCNT_dec (PL_rs); 956 SvREFCNT_dec (PL_rs);
949 SvREFCNT_dec (GvSV (irsgv)); 957 SvREFCNT_dec (GvSV (irsgv));
958 SvREFCNT_dec (GvHV (PL_hintgv));
950 959
951 SvREFCNT_dec (PL_diehook); 960 SvREFCNT_dec (PL_diehook);
952 SvREFCNT_dec (PL_warnhook); 961 SvREFCNT_dec (PL_warnhook);
953 962
954 SvREFCNT_dec (coro->saved_deffh); 963 SvREFCNT_dec (coro->saved_deffh);
1670 /* nothing to schedule: call the idle handler */ 1679 /* nothing to schedule: call the idle handler */
1671 if (SvROK (sv_idle) 1680 if (SvROK (sv_idle)
1672 && SvOBJECT (SvRV (sv_idle))) 1681 && SvOBJECT (SvRV (sv_idle)))
1673 { 1682 {
1674 ++coro_nready; /* hack so that api_ready doesn't invoke ready hook */ 1683 ++coro_nready; /* hack so that api_ready doesn't invoke ready hook */
1675 api_ready (SvRV (sv_idle)); 1684 api_ready (aTHX_ SvRV (sv_idle));
1676 --coro_nready; 1685 --coro_nready;
1677 } 1686 }
1678 else 1687 else
1679 { 1688 {
1680 dSP; 1689 dSP;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines