3 * Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
4 * 2000, 2001, 2002, 2003, 2004, 2005, by Larry Wall and others
6 * You may distribute under the terms of either the GNU General Public
7 * License or the Artistic License, as specified in the README file.
12 * "For the fashion of Minas Tirith was such that it was built on seven
16 /* This file contains functions to manipulate several of Perl's stacks;
17 * in particular it contains code to push various types of things onto
18 * the savestack, then to pop them off and perform the correct restorative
19 * action for each one. This corresponds to the cleanup Perl does at
24 #define PERL_IN_SCOPE_C
28 Perl_stack_grow(pTHX_ SV **sp, SV **p, int n)
31 #ifndef STRESS_REALLOC
32 av_extend(PL_curstack, (p - PL_stack_base) + (n) + 128);
34 av_extend(PL_curstack, (p - PL_stack_base) + (n) + 1);
39 #ifndef STRESS_REALLOC
40 #define GROW(old) ((old) * 3 / 2)
42 #define GROW(old) ((old) + 1)
46 Perl_new_stackinfo(pTHX_ I32 stitems, I32 cxitems)
50 si->si_stack = newAV();
51 AvREAL_off(si->si_stack);
52 av_extend(si->si_stack, stitems > 0 ? stitems-1 : 0);
53 AvALLOC(si->si_stack)[0] = &PL_sv_undef;
54 AvFILLp(si->si_stack) = 0;
57 si->si_cxmax = cxitems - 1;
59 si->si_type = PERLSI_UNDEF;
60 Newx(si->si_cxstack, cxitems, PERL_CONTEXT);
61 /* Without any kind of initialising PUSHSUBST()
62 * in pp_subst() will read uninitialised heap. */
63 Poison(si->si_cxstack, cxitems, PERL_CONTEXT);
70 const IV old_max = cxstack_max;
71 cxstack_max = GROW(cxstack_max);
72 Renew(cxstack, cxstack_max + 1, PERL_CONTEXT); /* XXX should fix CXINC macro */
73 /* Without any kind of initialising deep enough recursion
74 * will end up reading uninitialised PERL_CONTEXTs. */
75 Poison(cxstack + old_max + 1, cxstack_max - old_max, PERL_CONTEXT);
76 return cxstack_ix + 1;
82 if (PL_scopestack_ix == PL_scopestack_max) {
83 PL_scopestack_max = GROW(PL_scopestack_max);
84 Renew(PL_scopestack, PL_scopestack_max, I32);
86 PL_scopestack[PL_scopestack_ix++] = PL_savestack_ix;
93 const I32 oldsave = PL_scopestack[--PL_scopestack_ix];
98 Perl_markstack_grow(pTHX)
100 const I32 oldmax = PL_markstack_max - PL_markstack;
101 const I32 newmax = GROW(oldmax);
103 Renew(PL_markstack, newmax, I32);
104 PL_markstack_ptr = PL_markstack + oldmax;
105 PL_markstack_max = PL_markstack + newmax;
109 Perl_savestack_grow(pTHX)
111 PL_savestack_max = GROW(PL_savestack_max) + 4;
112 Renew(PL_savestack, PL_savestack_max, ANY);
116 Perl_savestack_grow_cnt(pTHX_ I32 need)
118 PL_savestack_max = PL_savestack_ix + need;
119 Renew(PL_savestack, PL_savestack_max, ANY);
125 Perl_tmps_grow(pTHX_ I32 n)
127 #ifndef STRESS_REALLOC
129 n = (PL_tmps_max < 512) ? 128 : 512;
131 PL_tmps_max = PL_tmps_ix + n + 1;
132 Renew(PL_tmps_stack, PL_tmps_max, SV*);
139 /* XXX should tmps_floor live in cxstack? */
140 const I32 myfloor = PL_tmps_floor;
141 while (PL_tmps_ix > myfloor) { /* clean up after last statement */
142 SV* const sv = PL_tmps_stack[PL_tmps_ix];
143 PL_tmps_stack[PL_tmps_ix--] = Nullsv;
144 if (sv && sv != &PL_sv_undef) {
146 SvREFCNT_dec(sv); /* note, can modify tmps_ix!!! */
152 S_save_scalar_at(pTHX_ SV **sptr)
154 SV * const osv = *sptr;
155 register SV * const sv = *sptr = NEWSV(0,0);
157 if (SvTYPE(osv) >= SVt_PVMG && SvMAGIC(osv) && SvTYPE(osv) != SVt_PVGV) {
158 if (SvGMAGICAL(osv)) {
159 const bool oldtainted = PL_tainted;
160 SvFLAGS(osv) |= (SvFLAGS(osv) &
161 (SVp_NOK|SVp_POK)) >> PRIVSHIFT;
162 PL_tainted = oldtainted;
164 mg_localize(osv, sv);
170 Perl_save_scalar(pTHX_ GV *gv)
172 SV **sptr = &GvSV(gv);
177 SSPUSHPTR(SvREFCNT_inc(gv));
178 SSPUSHPTR(SvREFCNT_inc(*sptr));
180 return save_scalar_at(sptr);
184 Perl_save_svref(pTHX_ SV **sptr)
189 SSPUSHPTR(SvREFCNT_inc(*sptr));
190 SSPUSHINT(SAVEt_SVREF);
191 return save_scalar_at(sptr);
194 /* Like save_sptr(), but also SvREFCNT_dec()s the new value. Can be used to
195 * restore a global SV to its prior contents, freeing new value. */
197 Perl_save_generic_svref(pTHX_ SV **sptr)
201 SSPUSHPTR(SvREFCNT_inc(*sptr));
202 SSPUSHINT(SAVEt_GENERIC_SVREF);
205 /* Like save_pptr(), but also Safefree()s the new value if it is different
206 * from the old one. Can be used to restore a global char* to its prior
207 * contents, freeing new value. */
209 Perl_save_generic_pvref(pTHX_ char **str)
214 SSPUSHINT(SAVEt_GENERIC_PVREF);
217 /* Like save_generic_pvref(), but uses PerlMemShared_free() rather than Safefree().
218 * Can be used to restore a shared global char* to its prior
219 * contents, freeing new value. */
221 Perl_save_shared_pvref(pTHX_ char **str)
226 SSPUSHINT(SAVEt_SHARED_PVREF);
229 /* set the SvFLAGS specified by mask to the values in val */
232 Perl_save_set_svflags(pTHX_ SV* sv, U32 mask, U32 val)
238 SSPUSHINT(SAVEt_SET_SVFLAGS);
242 Perl_save_gp(pTHX_ GV *gv, I32 empty)
245 SSPUSHIV((IV)SvLEN(gv));
246 SvLEN_set(gv, 0); /* forget that anything was allocated here */
247 SSPUSHIV((IV)SvCUR(gv));
248 SSPUSHPTR(SvPVX_const(gv));
250 SSPUSHPTR(SvREFCNT_inc(gv));
260 PL_sub_generation++; /* taking a method out of circulation */
261 if (GvIOp(gv) && (IoFLAGS(GvIOp(gv)) & IOf_ARGV)) {
263 IoFLAGS(gp->gp_io) |= IOf_ARGV|IOf_START;
265 GvGP(gv) = gp_ref(gp);
266 GvSV(gv) = NEWSV(72,0);
267 GvLINE(gv) = CopLINE(PL_curcop);
268 /* XXX Ideally this cast would be replaced with a change to const char*
270 GvFILE(gv) = CopFILE(PL_curcop) ? CopFILE(PL_curcop) : (char *) "";
280 Perl_save_ary(pTHX_ GV *gv)
282 AV * const oav = GvAVn(gv);
285 if (!AvREAL(oav) && AvREIFY(oav))
292 GvAV(gv) = Null(AV*);
295 mg_localize((SV*)oav, (SV*)av);
300 Perl_save_hash(pTHX_ GV *gv)
306 SSPUSHPTR(ohv = GvHVn(gv));
309 GvHV(gv) = Null(HV*);
312 mg_localize((SV*)ohv, (SV*)hv);
317 Perl_save_item(pTHX_ register SV *item)
319 register SV * const sv = newSVsv(item);
322 SSPUSHPTR(item); /* remember the pointer */
323 SSPUSHPTR(sv); /* remember the value */
324 SSPUSHINT(SAVEt_ITEM);
328 Perl_save_int(pTHX_ int *intp)
333 SSPUSHINT(SAVEt_INT);
337 Perl_save_long(pTHX_ long int *longp)
342 SSPUSHINT(SAVEt_LONG);
346 Perl_save_bool(pTHX_ bool *boolp)
351 SSPUSHINT(SAVEt_BOOL);
355 Perl_save_I32(pTHX_ I32 *intp)
360 SSPUSHINT(SAVEt_I32);
364 Perl_save_I16(pTHX_ I16 *intp)
369 SSPUSHINT(SAVEt_I16);
373 Perl_save_I8(pTHX_ I8 *bytep)
382 Perl_save_iv(pTHX_ IV *ivp)
390 /* Cannot use save_sptr() to store a char* since the SV** cast will
391 * force word-alignment and we'll miss the pointer.
394 Perl_save_pptr(pTHX_ char **pptr)
399 SSPUSHINT(SAVEt_PPTR);
403 Perl_save_vptr(pTHX_ void *ptr)
406 SSPUSHPTR(*(char**)ptr);
408 SSPUSHINT(SAVEt_VPTR);
412 Perl_save_sptr(pTHX_ SV **sptr)
417 SSPUSHINT(SAVEt_SPTR);
421 Perl_save_padsv(pTHX_ PADOFFSET off)
424 ASSERT_CURPAD_ACTIVE("save_padsv");
425 SSPUSHPTR(PL_curpad[off]);
426 SSPUSHPTR(PL_comppad);
427 SSPUSHLONG((long)off);
428 SSPUSHINT(SAVEt_PADSV);
432 Perl_save_threadsv(pTHX_ PADOFFSET i)
434 Perl_croak(aTHX_ "panic: save_threadsv called in non-threaded perl");
436 NORETURN_FUNCTION_END;
440 Perl_save_nogv(pTHX_ GV *gv)
444 SSPUSHINT(SAVEt_NSTAB);
448 Perl_save_hptr(pTHX_ HV **hptr)
453 SSPUSHINT(SAVEt_HPTR);
457 Perl_save_aptr(pTHX_ AV **aptr)
462 SSPUSHINT(SAVEt_APTR);
466 Perl_save_freesv(pTHX_ SV *sv)
470 SSPUSHINT(SAVEt_FREESV);
474 Perl_save_mortalizesv(pTHX_ SV *sv)
478 SSPUSHINT(SAVEt_MORTALIZESV);
482 Perl_save_freeop(pTHX_ OP *o)
486 SSPUSHINT(SAVEt_FREEOP);
490 Perl_save_freepv(pTHX_ char *pv)
494 SSPUSHINT(SAVEt_FREEPV);
498 Perl_save_clearsv(pTHX_ SV **svp)
500 ASSERT_CURPAD_ACTIVE("save_clearsv");
502 SSPUSHLONG((long)(svp-PL_curpad));
503 SSPUSHINT(SAVEt_CLEARSV);
504 SvPADSTALE_off(*svp); /* mark lexical as active */
508 Perl_save_delete(pTHX_ HV *hv, char *key, I32 klen)
513 SSPUSHPTR(SvREFCNT_inc(hv));
514 SSPUSHINT(SAVEt_DELETE);
518 Perl_save_list(pTHX_ register SV **sarg, I32 maxsarg)
522 for (i = 1; i <= maxsarg; i++) {
523 register SV * const sv = NEWSV(0,0);
524 sv_setsv(sv,sarg[i]);
526 SSPUSHPTR(sarg[i]); /* remember the pointer */
527 SSPUSHPTR(sv); /* remember the value */
528 SSPUSHINT(SAVEt_ITEM);
533 Perl_save_destructor(pTHX_ DESTRUCTORFUNC_NOCONTEXT_t f, void* p)
538 SSPUSHINT(SAVEt_DESTRUCTOR);
542 Perl_save_destructor_x(pTHX_ DESTRUCTORFUNC_t f, void* p)
547 SSPUSHINT(SAVEt_DESTRUCTOR_X);
551 Perl_save_aelem(pTHX_ const AV *av, I32 idx, SV **sptr)
556 SSPUSHPTR(SvREFCNT_inc(av));
558 SSPUSHPTR(SvREFCNT_inc(*sptr));
559 SSPUSHINT(SAVEt_AELEM);
560 /* if it gets reified later, the restore will have the wrong refcnt */
561 if (!AvREAL(av) && AvREIFY(av))
562 (void)SvREFCNT_inc(*sptr);
563 save_scalar_at(sptr);
565 /* If we're localizing a tied array element, this new sv
566 * won't actually be stored in the array - so it won't get
567 * reaped when the localize ends. Ensure it gets reaped by
568 * mortifying it instead. DAPM */
569 if (SvTIED_mg(sv, PERL_MAGIC_tiedelem))
574 Perl_save_helem(pTHX_ HV *hv, SV *key, SV **sptr)
579 SSPUSHPTR(SvREFCNT_inc(hv));
580 SSPUSHPTR(SvREFCNT_inc(key));
581 SSPUSHPTR(SvREFCNT_inc(*sptr));
582 SSPUSHINT(SAVEt_HELEM);
583 save_scalar_at(sptr);
585 /* If we're localizing a tied hash element, this new sv
586 * won't actually be stored in the hash - so it won't get
587 * reaped when the localize ends. Ensure it gets reaped by
588 * mortifying it instead. DAPM */
589 if (SvTIED_mg(sv, PERL_MAGIC_tiedelem))
602 Perl_save_alloc(pTHX_ I32 size, I32 pad)
604 register const I32 start = pad + ((char*)&PL_savestack[PL_savestack_ix]
605 - (char*)PL_savestack);
606 register const I32 elems = 1 + ((size + pad - 1) / sizeof(*PL_savestack));
608 /* SSCHECK may not be good enough */
609 while (PL_savestack_ix + elems + 2 > PL_savestack_max)
612 PL_savestack_ix += elems;
614 SSPUSHINT(SAVEt_ALLOC);
619 Perl_leave_scope(pTHX_ I32 base)
631 Perl_croak(aTHX_ "panic: corrupt saved stack index");
632 while (PL_savestack_ix > base) {
634 case SAVEt_ITEM: /* normal string */
635 value = (SV*)SSPOPPTR;
637 sv_replace(sv,value);
642 case SAVEt_SV: /* scalar reference */
643 value = (SV*)SSPOPPTR;
646 av = (AV*)gv; /* what to refcnt_dec */
648 case SAVEt_GENERIC_PVREF: /* generic pv */
649 str = (char*)SSPOPPTR;
651 if (*(char**)ptr != str) {
652 Safefree(*(char**)ptr);
656 case SAVEt_SHARED_PVREF: /* shared pv */
657 str = (char*)SSPOPPTR;
659 if (*(char**)ptr != str) {
661 PerlMem_free(*(char**)ptr);
663 PerlMemShared_free(*(char**)ptr);
668 case SAVEt_GENERIC_SVREF: /* generic sv */
669 value = (SV*)SSPOPPTR;
676 case SAVEt_SVREF: /* scalar reference */
677 value = (SV*)SSPOPPTR;
679 av = Nullav; /* what to refcnt_dec */
682 DEBUG_S(PerlIO_printf(Perl_debug_log,
683 "restore svref: %p %p:%s -> %p:%s\n",
684 ptr, sv, SvPEEK(sv), value, SvPEEK(value)));
691 if (av) /* actually an av, hv or gv */
694 case SAVEt_AV: /* array reference */
698 AV * const goner = GvAV(gv);
699 /* FIXME - this is a temporary hack until we work out what
700 the correct behaviour for magic should be. */
701 sv_unmagic((SV*)goner, PERL_MAGIC_arylen_p);
702 SvMAGIC_set(av, SvMAGIC(goner));
703 SvFLAGS((SV*)av) |= SvMAGICAL(goner);
704 SvMAGICAL_off(goner);
705 SvMAGIC_set(goner, NULL);
715 case SAVEt_HV: /* hash reference */
719 HV * const goner = GvHV(gv);
720 SvMAGIC_set(hv, SvMAGIC(goner));
721 SvFLAGS(hv) |= SvMAGICAL(goner);
722 SvMAGICAL_off(goner);
723 SvMAGIC_set(goner, NULL);
733 case SAVEt_INT: /* int reference */
735 *(int*)ptr = (int)SSPOPINT;
737 case SAVEt_LONG: /* long reference */
739 *(long*)ptr = (long)SSPOPLONG;
741 case SAVEt_BOOL: /* bool reference */
743 *(bool*)ptr = (bool)SSPOPBOOL;
745 case SAVEt_I32: /* I32 reference */
747 *(I32*)ptr = (I32)SSPOPINT;
749 case SAVEt_I16: /* I16 reference */
751 *(I16*)ptr = (I16)SSPOPINT;
753 case SAVEt_I8: /* I8 reference */
755 *(I8*)ptr = (I8)SSPOPINT;
757 case SAVEt_IV: /* IV reference */
759 *(IV*)ptr = (IV)SSPOPIV;
761 case SAVEt_SPTR: /* SV* reference */
763 *(SV**)ptr = (SV*)SSPOPPTR;
765 case SAVEt_VPTR: /* random* reference */
766 case SAVEt_PPTR: /* char* reference */
768 *(char**)ptr = (char*)SSPOPPTR;
770 case SAVEt_HPTR: /* HV* reference */
772 *(HV**)ptr = (HV*)SSPOPPTR;
774 case SAVEt_APTR: /* AV* reference */
776 *(AV**)ptr = (AV*)SSPOPPTR;
780 (void)sv_clear((SV*)gv);
782 case SAVEt_GP: /* scalar reference */
785 if (SvPVX_const(gv) && SvLEN(gv) > 0) {
786 Safefree(SvPVX_mutable(gv));
788 SvPV_set(gv, (char *)SSPOPPTR);
789 SvCUR_set(gv, (STRLEN)SSPOPIV);
790 SvLEN_set(gv, (STRLEN)SSPOPIV);
794 PL_sub_generation++; /* putting a method back into circulation */
799 SvREFCNT_dec((SV*)ptr);
801 case SAVEt_MORTALIZESV:
803 sv_2mortal((SV*)ptr);
807 ASSERT_CURPAD_LEGAL("SAVEt_FREEOP"); /* XXX DAPM tmp */
815 ptr = (void*)&PL_curpad[SSPOPLONG];
818 DEBUG_Xv(PerlIO_printf(Perl_debug_log,
819 "Pad 0x%"UVxf"[0x%"UVxf"] clearsv: %ld sv=0x%"UVxf"<%"IVdf"> %s\n",
820 PTR2UV(PL_comppad), PTR2UV(PL_curpad),
821 (long)((SV **)ptr-PL_curpad), PTR2UV(sv), (IV)SvREFCNT(sv),
822 (SvREFCNT(sv) <= 1 && !SvOBJECT(sv)) ? "clear" : "abandon"
825 /* Can clear pad variable in place? */
826 if (SvREFCNT(sv) <= 1 && !SvOBJECT(sv)) {
828 * if a my variable that was made readonly is going out of
829 * scope, we want to remove the readonlyness so that it can
830 * go out of scope quietly
832 if (SvPADMY(sv) && !SvFAKE(sv))
835 if (SvTHINKFIRST(sv))
836 sv_force_normal_flags(sv, SV_IMMEDIATE_UNREF);
840 switch (SvTYPE(sv)) {
850 Perl_croak(aTHX_ "panic: leave_scope pad code");
855 SvPADSTALE_on(sv); /* mark as no longer live */
857 else { /* Someone has a claim on this, so abandon it. */
858 const U32 padflags = SvFLAGS(sv) & (SVs_PADMY|SVs_PADTMP);
859 switch (SvTYPE(sv)) { /* Console ourselves with a new value */
860 case SVt_PVAV: *(SV**)ptr = (SV*)newAV(); break;
861 case SVt_PVHV: *(SV**)ptr = (SV*)newHV(); break;
862 default: *(SV**)ptr = NEWSV(0,0); break;
864 SvREFCNT_dec(sv); /* Cast current value to the winds. */
865 /* preserve pad nature, but also mark as not live
866 * for any closure capturing */
867 SvFLAGS(*(SV**)ptr) |= padflags | SVs_PADSTALE;
874 (void)hv_delete(hv, (char*)ptr, (U32)SSPOPINT, G_DISCARD);
878 case SAVEt_DESTRUCTOR:
882 case SAVEt_DESTRUCTOR_X:
884 (*SSPOPDXPTR)(aTHX_ ptr);
886 case SAVEt_REGCONTEXT:
889 PL_savestack_ix -= i; /* regexp must have croaked */
891 case SAVEt_STACK_POS: /* Position on Perl stack */
893 PL_stack_sp = PL_stack_base + i;
895 case SAVEt_AELEM: /* array element */
896 value = (SV*)SSPOPPTR;
899 if (!AvREAL(av) && AvREIFY(av)) /* undo reify guard */
901 ptr = av_fetch(av,i,1);
904 if (sv && sv != &PL_sv_undef) {
905 if (SvTIED_mg((SV*)av, PERL_MAGIC_tied))
906 (void)SvREFCNT_inc(sv);
913 case SAVEt_HELEM: /* hash element */
914 value = (SV*)SSPOPPTR;
917 ptr = hv_fetch_ent(hv, sv, 1, 0);
919 const SV * const oval = HeVAL((HE*)ptr);
920 if (oval && oval != &PL_sv_undef) {
921 ptr = &HeVAL((HE*)ptr);
922 if (SvTIED_mg((SV*)hv, PERL_MAGIC_tied))
923 (void)SvREFCNT_inc(*(SV**)ptr);
925 av = (AV*)hv; /* what to refcnt_dec */
934 PL_op = (OP*)SSPOPPTR;
937 if ((PL_hints & HINT_LOCALIZE_HH) && GvHV(PL_hintgv)) {
938 SvREFCNT_dec((SV*)GvHV(PL_hintgv));
939 GvHV(PL_hintgv) = NULL;
941 *(I32*)&PL_hints = (I32)SSPOPINT;
942 if (PL_hints & HINT_LOCALIZE_HH) {
943 SvREFCNT_dec((SV*)GvHV(PL_hintgv));
944 GvHV(PL_hintgv) = (HV*)SSPOPPTR;
949 PL_comppad = (PAD*)SSPOPPTR;
951 PL_curpad = AvARRAY(PL_comppad);
953 PL_curpad = Null(SV**);
957 const PADOFFSET off = (PADOFFSET)SSPOPLONG;
960 AvARRAY((PAD*)ptr)[off] = (SV*)SSPOPPTR;
963 case SAVEt_SAVESWITCHSTACK:
966 AV* t = (AV*)SSPOPPTR;
967 AV* f = (AV*)SSPOPPTR;
969 PL_curstackinfo->si_stack = f;
972 case SAVEt_SET_SVFLAGS:
974 const U32 val = (U32)SSPOPINT;
975 const U32 mask = (U32)SSPOPINT;
977 SvFLAGS(sv) &= ~mask;
982 Perl_croak(aTHX_ "panic: leave_scope inconsistency");
988 Perl_cx_dump(pTHX_ PERL_CONTEXT *cx)
991 PerlIO_printf(Perl_debug_log, "CX %ld = %s\n", (long)(cx - cxstack), PL_block_type[CxTYPE(cx)]);
992 if (CxTYPE(cx) != CXt_SUBST) {
993 PerlIO_printf(Perl_debug_log, "BLK_OLDSP = %ld\n", (long)cx->blk_oldsp);
994 PerlIO_printf(Perl_debug_log, "BLK_OLDCOP = 0x%"UVxf"\n",
995 PTR2UV(cx->blk_oldcop));
996 PerlIO_printf(Perl_debug_log, "BLK_OLDMARKSP = %ld\n", (long)cx->blk_oldmarksp);
997 PerlIO_printf(Perl_debug_log, "BLK_OLDSCOPESP = %ld\n", (long)cx->blk_oldscopesp);
998 PerlIO_printf(Perl_debug_log, "BLK_OLDPM = 0x%"UVxf"\n",
999 PTR2UV(cx->blk_oldpm));
1000 PerlIO_printf(Perl_debug_log, "BLK_GIMME = %s\n", cx->blk_gimme ? "LIST" : "SCALAR");
1002 switch (CxTYPE(cx)) {
1007 PerlIO_printf(Perl_debug_log, "BLK_SUB.CV = 0x%"UVxf"\n",
1008 PTR2UV(cx->blk_sub.cv));
1009 PerlIO_printf(Perl_debug_log, "BLK_SUB.GV = 0x%"UVxf"\n",
1010 PTR2UV(cx->blk_sub.gv));
1011 PerlIO_printf(Perl_debug_log, "BLK_SUB.DFOUTGV = 0x%"UVxf"\n",
1012 PTR2UV(cx->blk_sub.dfoutgv));
1013 PerlIO_printf(Perl_debug_log, "BLK_SUB.HASARGS = %d\n",
1014 (int)cx->blk_sub.hasargs);
1015 PerlIO_printf(Perl_debug_log, "BLK_SUB.RETOP = 0x%"UVxf"\n",
1016 PTR2UV(cx->blk_sub.retop));
1019 PerlIO_printf(Perl_debug_log, "BLK_SUB.CV = 0x%"UVxf"\n",
1020 PTR2UV(cx->blk_sub.cv));
1021 PerlIO_printf(Perl_debug_log, "BLK_SUB.OLDDEPTH = %ld\n",
1022 (long)cx->blk_sub.olddepth);
1023 PerlIO_printf(Perl_debug_log, "BLK_SUB.HASARGS = %d\n",
1024 (int)cx->blk_sub.hasargs);
1025 PerlIO_printf(Perl_debug_log, "BLK_SUB.LVAL = %d\n",
1026 (int)cx->blk_sub.lval);
1027 PerlIO_printf(Perl_debug_log, "BLK_SUB.RETOP = 0x%"UVxf"\n",
1028 PTR2UV(cx->blk_sub.retop));
1031 PerlIO_printf(Perl_debug_log, "BLK_EVAL.OLD_IN_EVAL = %ld\n",
1032 (long)cx->blk_eval.old_in_eval);
1033 PerlIO_printf(Perl_debug_log, "BLK_EVAL.OLD_OP_TYPE = %s (%s)\n",
1034 PL_op_name[cx->blk_eval.old_op_type],
1035 PL_op_desc[cx->blk_eval.old_op_type]);
1036 if (cx->blk_eval.old_namesv)
1037 PerlIO_printf(Perl_debug_log, "BLK_EVAL.OLD_NAME = %s\n",
1038 SvPVX_const(cx->blk_eval.old_namesv));
1039 PerlIO_printf(Perl_debug_log, "BLK_EVAL.OLD_EVAL_ROOT = 0x%"UVxf"\n",
1040 PTR2UV(cx->blk_eval.old_eval_root));
1041 PerlIO_printf(Perl_debug_log, "BLK_EVAL.RETOP = 0x%"UVxf"\n",
1042 PTR2UV(cx->blk_eval.retop));
1046 PerlIO_printf(Perl_debug_log, "BLK_LOOP.LABEL = %s\n",
1047 cx->blk_loop.label);
1048 PerlIO_printf(Perl_debug_log, "BLK_LOOP.RESETSP = %ld\n",
1049 (long)cx->blk_loop.resetsp);
1050 PerlIO_printf(Perl_debug_log, "BLK_LOOP.REDO_OP = 0x%"UVxf"\n",
1051 PTR2UV(cx->blk_loop.redo_op));
1052 PerlIO_printf(Perl_debug_log, "BLK_LOOP.NEXT_OP = 0x%"UVxf"\n",
1053 PTR2UV(cx->blk_loop.next_op));
1054 PerlIO_printf(Perl_debug_log, "BLK_LOOP.LAST_OP = 0x%"UVxf"\n",
1055 PTR2UV(cx->blk_loop.last_op));
1056 PerlIO_printf(Perl_debug_log, "BLK_LOOP.ITERIX = %ld\n",
1057 (long)cx->blk_loop.iterix);
1058 PerlIO_printf(Perl_debug_log, "BLK_LOOP.ITERARY = 0x%"UVxf"\n",
1059 PTR2UV(cx->blk_loop.iterary));
1060 PerlIO_printf(Perl_debug_log, "BLK_LOOP.ITERVAR = 0x%"UVxf"\n",
1061 PTR2UV(CxITERVAR(cx)));
1063 PerlIO_printf(Perl_debug_log, "BLK_LOOP.ITERSAVE = 0x%"UVxf"\n",
1064 PTR2UV(cx->blk_loop.itersave));
1065 PerlIO_printf(Perl_debug_log, "BLK_LOOP.ITERLVAL = 0x%"UVxf"\n",
1066 PTR2UV(cx->blk_loop.iterlval));
1070 PerlIO_printf(Perl_debug_log, "SB_ITERS = %ld\n",
1071 (long)cx->sb_iters);
1072 PerlIO_printf(Perl_debug_log, "SB_MAXITERS = %ld\n",
1073 (long)cx->sb_maxiters);
1074 PerlIO_printf(Perl_debug_log, "SB_RFLAGS = %ld\n",
1075 (long)cx->sb_rflags);
1076 PerlIO_printf(Perl_debug_log, "SB_ONCE = %ld\n",
1078 PerlIO_printf(Perl_debug_log, "SB_ORIG = %s\n",
1080 PerlIO_printf(Perl_debug_log, "SB_DSTR = 0x%"UVxf"\n",
1081 PTR2UV(cx->sb_dstr));
1082 PerlIO_printf(Perl_debug_log, "SB_TARG = 0x%"UVxf"\n",
1083 PTR2UV(cx->sb_targ));
1084 PerlIO_printf(Perl_debug_log, "SB_S = 0x%"UVxf"\n",
1086 PerlIO_printf(Perl_debug_log, "SB_M = 0x%"UVxf"\n",
1088 PerlIO_printf(Perl_debug_log, "SB_STREND = 0x%"UVxf"\n",
1089 PTR2UV(cx->sb_strend));
1090 PerlIO_printf(Perl_debug_log, "SB_RXRES = 0x%"UVxf"\n",
1091 PTR2UV(cx->sb_rxres));
1094 #endif /* DEBUGGING */
1099 * c-indentation-style: bsd
1101 * indent-tabs-mode: t
1104 * ex: set ts=8 sts=4 sw=4 noet: