3 * Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
4 * 2000, 2001, 2002, 2003, 2004, 2005, 2006, 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)
32 #ifndef STRESS_REALLOC
33 av_extend(PL_curstack, (p - PL_stack_base) + (n) + 128);
35 av_extend(PL_curstack, (p - PL_stack_base) + (n) + 1);
40 #ifndef STRESS_REALLOC
41 #define GROW(old) ((old) * 3 / 2)
43 #define GROW(old) ((old) + 1)
47 Perl_new_stackinfo(pTHX_ I32 stitems, I32 cxitems)
52 si->si_stack = newAV();
53 AvREAL_off(si->si_stack);
54 av_extend(si->si_stack, stitems > 0 ? stitems-1 : 0);
55 AvALLOC(si->si_stack)[0] = &PL_sv_undef;
56 AvFILLp(si->si_stack) = 0;
59 si->si_cxmax = cxitems - 1;
61 si->si_type = PERLSI_UNDEF;
62 Newx(si->si_cxstack, cxitems, PERL_CONTEXT);
63 /* Without any kind of initialising PUSHSUBST()
64 * in pp_subst() will read uninitialised heap. */
65 PoisonNew(si->si_cxstack, cxitems, PERL_CONTEXT);
73 const IV old_max = cxstack_max;
74 cxstack_max = GROW(cxstack_max);
75 Renew(cxstack, cxstack_max + 1, PERL_CONTEXT); /* XXX should fix CXINC macro */
76 /* Without any kind of initialising deep enough recursion
77 * will end up reading uninitialised PERL_CONTEXTs. */
78 PoisonNew(cxstack + old_max + 1, cxstack_max - old_max, PERL_CONTEXT);
79 return cxstack_ix + 1;
86 if (PL_scopestack_ix == PL_scopestack_max) {
87 PL_scopestack_max = GROW(PL_scopestack_max);
88 Renew(PL_scopestack, PL_scopestack_max, I32);
90 PL_scopestack[PL_scopestack_ix++] = PL_savestack_ix;
98 const I32 oldsave = PL_scopestack[--PL_scopestack_ix];
103 Perl_markstack_grow(pTHX)
106 const I32 oldmax = PL_markstack_max - PL_markstack;
107 const I32 newmax = GROW(oldmax);
109 Renew(PL_markstack, newmax, I32);
110 PL_markstack_ptr = PL_markstack + oldmax;
111 PL_markstack_max = PL_markstack + newmax;
115 Perl_savestack_grow(pTHX)
118 PL_savestack_max = GROW(PL_savestack_max) + 4;
119 Renew(PL_savestack, PL_savestack_max, ANY);
123 Perl_savestack_grow_cnt(pTHX_ I32 need)
126 PL_savestack_max = PL_savestack_ix + need;
127 Renew(PL_savestack, PL_savestack_max, ANY);
133 Perl_tmps_grow(pTHX_ I32 n)
136 #ifndef STRESS_REALLOC
138 n = (PL_tmps_max < 512) ? 128 : 512;
140 PL_tmps_max = PL_tmps_ix + n + 1;
141 Renew(PL_tmps_stack, PL_tmps_max, SV*);
149 /* XXX should tmps_floor live in cxstack? */
150 const I32 myfloor = PL_tmps_floor;
151 while (PL_tmps_ix > myfloor) { /* clean up after last statement */
152 SV* const sv = PL_tmps_stack[PL_tmps_ix];
153 PL_tmps_stack[PL_tmps_ix--] = NULL;
154 if (sv && sv != &PL_sv_undef) {
156 SvREFCNT_dec(sv); /* note, can modify tmps_ix!!! */
162 S_save_scalar_at(pTHX_ SV **sptr)
165 SV * const osv = *sptr;
166 register SV * const sv = *sptr = newSV(0);
169 /* FIXME for MAD - this is causing ext/Safe/t/safeops.t to abort. */
170 if (PL_formfeed && sv == PL_formfeed)
174 if (SvTYPE(osv) >= SVt_PVMG && SvMAGIC(osv) && SvTYPE(osv) != SVt_PVGV) {
175 if (SvGMAGICAL(osv)) {
176 const bool oldtainted = PL_tainted;
177 SvFLAGS(osv) |= (SvFLAGS(osv) &
178 (SVp_IOK|SVp_NOK|SVp_POK)) >> PRIVSHIFT;
179 PL_tainted = oldtainted;
181 mg_localize(osv, sv);
187 Perl_save_scalar(pTHX_ GV *gv)
190 SV ** const sptr = &GvSVn(gv);
192 if (PL_formfeed && *sptr == PL_formfeed)
199 SSPUSHPTR(SvREFCNT_inc_simple(gv));
200 SSPUSHPTR(SvREFCNT_inc(*sptr));
202 return save_scalar_at(sptr);
205 /* Like save_sptr(), but also SvREFCNT_dec()s the new value. Can be used to
206 * restore a global SV to its prior contents, freeing new value. */
208 Perl_save_generic_svref(pTHX_ SV **sptr)
212 if (PL_formfeed && *sptr == PL_formfeed)
217 SSPUSHPTR(SvREFCNT_inc(*sptr));
218 SSPUSHINT(SAVEt_GENERIC_SVREF);
221 /* Like save_pptr(), but also Safefree()s the new value if it is different
222 * from the old one. Can be used to restore a global char* to its prior
223 * contents, freeing new value. */
225 Perl_save_generic_pvref(pTHX_ char **str)
231 SSPUSHINT(SAVEt_GENERIC_PVREF);
234 /* Like save_generic_pvref(), but uses PerlMemShared_free() rather than Safefree().
235 * Can be used to restore a shared global char* to its prior
236 * contents, freeing new value. */
238 Perl_save_shared_pvref(pTHX_ char **str)
244 SSPUSHINT(SAVEt_SHARED_PVREF);
247 /* set the SvFLAGS specified by mask to the values in val */
250 Perl_save_set_svflags(pTHX_ SV* sv, U32 mask, U32 val)
257 SSPUSHINT(SAVEt_SET_SVFLAGS);
261 Perl_save_gp(pTHX_ GV *gv, I32 empty)
265 SSPUSHPTR(SvREFCNT_inc(gv));
275 PL_sub_generation++; /* taking a method out of circulation */
276 if (GvIOp(gv) && (IoFLAGS(GvIOp(gv)) & IOf_ARGV)) {
278 IoFLAGS(gp->gp_io) |= IOf_ARGV|IOf_START;
280 GvGP(gv) = gp_ref(gp);
281 #ifndef PERL_DONT_CREATE_GVSV
284 GvLINE(gv) = CopLINE(PL_curcop);
285 /* XXX Ideally this cast would be replaced with a change to const char*
287 GvFILE(gv) = CopFILE(PL_curcop) ? CopFILE(PL_curcop) : (char *) "";
297 Perl_save_ary(pTHX_ GV *gv)
300 AV * const oav = GvAVn(gv);
303 if (!AvREAL(oav) && AvREIFY(oav))
313 mg_localize((SV*)oav, (SV*)av);
318 Perl_save_hash(pTHX_ GV *gv)
325 SSPUSHPTR(ohv = GvHVn(gv));
331 mg_localize((SV*)ohv, (SV*)hv);
336 Perl_save_item(pTHX_ register SV *item)
339 register SV * const sv = newSVsv(item);
342 if (PL_formfeed && item == PL_formfeed)
347 SSPUSHPTR(item); /* remember the pointer */
348 SSPUSHPTR(sv); /* remember the value */
349 SSPUSHINT(SAVEt_ITEM);
353 Perl_save_int(pTHX_ int *intp)
359 SSPUSHINT(SAVEt_INT);
363 Perl_save_bool(pTHX_ bool *boolp)
369 SSPUSHINT(SAVEt_BOOL);
373 Perl_save_I32(pTHX_ I32 *intp)
379 SSPUSHINT(SAVEt_I32);
382 /* Cannot use save_sptr() to store a char* since the SV** cast will
383 * force word-alignment and we'll miss the pointer.
386 Perl_save_pptr(pTHX_ char **pptr)
392 SSPUSHINT(SAVEt_PPTR);
396 Perl_save_vptr(pTHX_ void *ptr)
400 SSPUSHPTR(*(char**)ptr);
402 SSPUSHINT(SAVEt_VPTR);
406 Perl_save_sptr(pTHX_ SV **sptr)
412 SSPUSHINT(SAVEt_SPTR);
416 Perl_save_padsv(pTHX_ PADOFFSET off)
420 ASSERT_CURPAD_ACTIVE("save_padsv");
421 SSPUSHPTR(PL_curpad[off]);
422 SSPUSHPTR(PL_comppad);
423 SSPUSHLONG((long)off);
424 SSPUSHINT(SAVEt_PADSV);
428 Perl_save_hptr(pTHX_ HV **hptr)
434 SSPUSHINT(SAVEt_HPTR);
438 Perl_save_aptr(pTHX_ AV **aptr)
444 SSPUSHINT(SAVEt_APTR);
448 Perl_save_freesv(pTHX_ SV *sv)
453 SSPUSHINT(SAVEt_FREESV);
457 Perl_save_mortalizesv(pTHX_ SV *sv)
462 SSPUSHINT(SAVEt_MORTALIZESV);
466 Perl_save_freeop(pTHX_ OP *o)
471 SSPUSHINT(SAVEt_FREEOP);
475 Perl_save_freepv(pTHX_ char *pv)
480 SSPUSHINT(SAVEt_FREEPV);
484 Perl_save_clearsv(pTHX_ SV **svp)
487 ASSERT_CURPAD_ACTIVE("save_clearsv");
489 SSPUSHLONG((long)(svp-PL_curpad));
490 SSPUSHINT(SAVEt_CLEARSV);
491 SvPADSTALE_off(*svp); /* mark lexical as active */
495 Perl_save_delete(pTHX_ HV *hv, char *key, I32 klen)
501 SSPUSHPTR(SvREFCNT_inc_simple(hv));
502 SSPUSHINT(SAVEt_DELETE);
506 Perl_save_destructor_x(pTHX_ DESTRUCTORFUNC_t f, void* p)
512 SSPUSHINT(SAVEt_DESTRUCTOR_X);
516 Perl_save_aelem(pTHX_ AV *av, I32 idx, SV **sptr)
522 SSPUSHPTR(SvREFCNT_inc_simple(av));
524 SSPUSHPTR(SvREFCNT_inc(*sptr));
525 SSPUSHINT(SAVEt_AELEM);
526 /* if it gets reified later, the restore will have the wrong refcnt */
527 if (!AvREAL(av) && AvREIFY(av))
528 SvREFCNT_inc_void(*sptr);
529 save_scalar_at(sptr);
531 /* If we're localizing a tied array element, this new sv
532 * won't actually be stored in the array - so it won't get
533 * reaped when the localize ends. Ensure it gets reaped by
534 * mortifying it instead. DAPM */
535 if (SvTIED_mg(sv, PERL_MAGIC_tiedelem))
540 Perl_save_helem(pTHX_ HV *hv, SV *key, SV **sptr)
546 SSPUSHPTR(SvREFCNT_inc_simple(hv));
547 SSPUSHPTR(SvREFCNT_inc_simple(key));
548 SSPUSHPTR(SvREFCNT_inc(*sptr));
549 SSPUSHINT(SAVEt_HELEM);
550 save_scalar_at(sptr);
552 /* If we're localizing a tied hash element, this new sv
553 * won't actually be stored in the hash - so it won't get
554 * reaped when the localize ends. Ensure it gets reaped by
555 * mortifying it instead. DAPM */
556 if (SvTIED_mg(sv, PERL_MAGIC_tiedelem))
561 Perl_save_svref(pTHX_ SV **sptr)
565 if (PL_formfeed && *sptr == PL_formfeed)
571 SSPUSHPTR(SvREFCNT_inc(*sptr));
572 SSPUSHINT(SAVEt_SVREF);
573 return save_scalar_at(sptr);
586 Perl_save_alloc(pTHX_ I32 size, I32 pad)
589 register const I32 start = pad + ((char*)&PL_savestack[PL_savestack_ix]
590 - (char*)PL_savestack);
591 register const I32 elems = 1 + ((size + pad - 1) / sizeof(*PL_savestack));
595 PL_savestack_ix += elems;
597 SSPUSHINT(SAVEt_ALLOC);
602 Perl_leave_scope(pTHX_ I32 base)
615 Perl_croak(aTHX_ "panic: corrupt saved stack index");
616 while (PL_savestack_ix > base) {
618 case SAVEt_ITEM: /* normal string */
619 value = (SV*)SSPOPPTR;
621 sv_replace(sv,value);
626 case SAVEt_SV: /* scalar reference */
627 value = (SV*)SSPOPPTR;
630 av = (AV*)gv; /* what to refcnt_dec */
633 DEBUG_S(PerlIO_printf(Perl_debug_log,
634 "restore svref: %p %p:%s -> %p:%s\n",
635 ptr, sv, SvPEEK(sv), value, SvPEEK(value)));
642 if (av) /* actually an av, hv or gv */
645 case SAVEt_GENERIC_PVREF: /* generic pv */
646 str = (char*)SSPOPPTR;
648 if (*(char**)ptr != str) {
649 Safefree(*(char**)ptr);
653 case SAVEt_SHARED_PVREF: /* shared pv */
654 str = (char*)SSPOPPTR;
656 if (*(char**)ptr != str) {
658 PerlMem_free(*(char**)ptr);
660 PerlMemShared_free(*(char**)ptr);
665 case SAVEt_GENERIC_SVREF: /* generic sv */
666 value = (SV*)SSPOPPTR;
673 case SAVEt_AV: /* array reference */
677 AV * const goner = GvAV(gv);
678 /* FIXME - this is a temporary hack until we work out what
679 the correct behaviour for magic should be. */
680 sv_unmagic((SV*)goner, PERL_MAGIC_arylen_p);
681 SvMAGIC_set(av, SvMAGIC(goner));
682 SvFLAGS((SV*)av) |= SvMAGICAL(goner);
683 SvMAGICAL_off(goner);
684 SvMAGIC_set(goner, NULL);
694 case SAVEt_HV: /* hash reference */
698 HV * const goner = GvHV(gv);
699 SvMAGIC_set(hv, SvMAGIC(goner));
700 SvFLAGS(hv) |= SvMAGICAL(goner);
701 SvMAGICAL_off(goner);
702 SvMAGIC_set(goner, NULL);
712 case SAVEt_INT: /* int reference */
714 *(int*)ptr = (int)SSPOPINT;
716 case SAVEt_BOOL: /* bool reference */
718 *(bool*)ptr = (bool)SSPOPBOOL;
720 case SAVEt_I32: /* I32 reference */
722 *(I32*)ptr = (I32)SSPOPINT;
724 case SAVEt_SPTR: /* SV* reference */
726 *(SV**)ptr = (SV*)SSPOPPTR;
728 case SAVEt_VPTR: /* random* reference */
729 case SAVEt_PPTR: /* char* reference */
731 *(char**)ptr = (char*)SSPOPPTR;
733 case SAVEt_HPTR: /* HV* reference */
735 *(HV**)ptr = (HV*)SSPOPPTR;
737 case SAVEt_APTR: /* AV* reference */
739 *(AV**)ptr = (AV*)SSPOPPTR;
741 case SAVEt_GP: /* scalar reference */
747 PL_sub_generation++; /* putting a method back into circulation */
752 SvREFCNT_dec((SV*)ptr);
754 case SAVEt_MORTALIZESV:
756 sv_2mortal((SV*)ptr);
760 ASSERT_CURPAD_LEGAL("SAVEt_FREEOP"); /* XXX DAPM tmp */
768 ptr = (void*)&PL_curpad[SSPOPLONG];
771 DEBUG_Xv(PerlIO_printf(Perl_debug_log,
772 "Pad 0x%"UVxf"[0x%"UVxf"] clearsv: %ld sv=0x%"UVxf"<%"IVdf"> %s\n",
773 PTR2UV(PL_comppad), PTR2UV(PL_curpad),
774 (long)((SV **)ptr-PL_curpad), PTR2UV(sv), (IV)SvREFCNT(sv),
775 (SvREFCNT(sv) <= 1 && !SvOBJECT(sv)) ? "clear" : "abandon"
778 /* Can clear pad variable in place? */
779 if (SvREFCNT(sv) <= 1 && !SvOBJECT(sv)) {
781 * if a my variable that was made readonly is going out of
782 * scope, we want to remove the readonlyness so that it can
783 * go out of scope quietly
785 if (SvPADMY(sv) && !SvFAKE(sv))
788 if (SvTHINKFIRST(sv))
789 sv_force_normal_flags(sv, SV_IMMEDIATE_UNREF);
793 switch (SvTYPE(sv)) {
803 Perl_croak(aTHX_ "panic: leave_scope pad code");
808 SvPADSTALE_on(sv); /* mark as no longer live */
810 else { /* Someone has a claim on this, so abandon it. */
811 const U32 padflags = SvFLAGS(sv) & (SVs_PADMY|SVs_PADTMP);
812 switch (SvTYPE(sv)) { /* Console ourselves with a new value */
813 case SVt_PVAV: *(SV**)ptr = (SV*)newAV(); break;
814 case SVt_PVHV: *(SV**)ptr = (SV*)newHV(); break;
815 default: *(SV**)ptr = newSV(0); break;
817 SvREFCNT_dec(sv); /* Cast current value to the winds. */
818 /* preserve pad nature, but also mark as not live
819 * for any closure capturing */
820 SvFLAGS(*(SV**)ptr) |= padflags | SVs_PADSTALE;
827 (void)hv_delete(hv, (char*)ptr, (I32)SSPOPINT, G_DISCARD);
831 case SAVEt_DESTRUCTOR_X:
833 (*SSPOPDXPTR)(aTHX_ ptr);
835 case SAVEt_REGCONTEXT:
838 PL_savestack_ix -= i; /* regexp must have croaked */
840 case SAVEt_STACK_POS: /* Position on Perl stack */
842 PL_stack_sp = PL_stack_base + i;
844 case SAVEt_AELEM: /* array element */
845 value = (SV*)SSPOPPTR;
848 if (!AvREAL(av) && AvREIFY(av)) /* undo reify guard */
850 ptr = av_fetch(av,i,1);
853 if (sv && sv != &PL_sv_undef) {
854 if (SvTIED_mg((SV*)av, PERL_MAGIC_tied))
855 SvREFCNT_inc_void_NN(sv);
862 case SAVEt_HELEM: /* hash element */
863 value = (SV*)SSPOPPTR;
866 ptr = hv_fetch_ent(hv, sv, 1, 0);
868 const SV * const oval = HeVAL((HE*)ptr);
869 if (oval && oval != &PL_sv_undef) {
870 ptr = &HeVAL((HE*)ptr);
871 if (SvTIED_mg((SV*)hv, PERL_MAGIC_tied))
872 SvREFCNT_inc_void(*(SV**)ptr);
874 av = (AV*)hv; /* what to refcnt_dec */
883 PL_op = (OP*)SSPOPPTR;
886 if ((PL_hints & HINT_LOCALIZE_HH) && GvHV(PL_hintgv)) {
887 SvREFCNT_dec((SV*)GvHV(PL_hintgv));
888 GvHV(PL_hintgv) = NULL;
890 *(I32*)&PL_hints = (I32)SSPOPINT;
891 Perl_refcounted_he_free(aTHX_ PL_compiling.cop_hints);
892 PL_compiling.cop_hints = (struct refcounted_he *) SSPOPPTR;
893 if (PL_hints & HINT_LOCALIZE_HH) {
894 SvREFCNT_dec((SV*)GvHV(PL_hintgv));
895 GvHV(PL_hintgv) = (HV*)SSPOPPTR;
896 assert(GvHV(PL_hintgv));
897 } else if (!GvHV(PL_hintgv)) {
898 /* Need to add a new one manually, else gv_fetchpv() can
899 add one in this code:
901 if (SvTYPE(gv) == SVt_PVGV) {
904 gv_init_sv(gv, sv_type);
905 if (*name=='!' && sv_type == SVt_PVHV && len==1)
911 and it won't have the magic set. */
913 HV *const hv = newHV();
914 hv_magic(hv, NULL, PERL_MAGIC_hints);
915 GvHV(PL_hintgv) = hv;
917 assert(GvHV(PL_hintgv));
920 PL_comppad = (PAD*)SSPOPPTR;
922 PL_curpad = AvARRAY(PL_comppad);
928 const PADOFFSET off = (PADOFFSET)SSPOPLONG;
931 AvARRAY((PAD*)ptr)[off] = (SV*)SSPOPPTR;
934 case SAVEt_SAVESWITCHSTACK:
937 AV* const t = (AV*)SSPOPPTR;
938 AV* const f = (AV*)SSPOPPTR;
940 PL_curstackinfo->si_stack = f;
943 case SAVEt_SET_SVFLAGS:
945 const U32 val = (U32)SSPOPINT;
946 const U32 mask = (U32)SSPOPINT;
948 SvFLAGS(sv) &= ~mask;
952 /* These are only saved in mathoms.c */
953 case SAVEt_SVREF: /* scalar reference */
954 value = (SV*)SSPOPPTR;
956 av = NULL; /* what to refcnt_dec */
958 case SAVEt_LONG: /* long reference */
960 *(long*)ptr = (long)SSPOPLONG;
962 case SAVEt_I16: /* I16 reference */
964 *(I16*)ptr = (I16)SSPOPINT;
966 case SAVEt_I8: /* I8 reference */
968 *(I8*)ptr = (I8)SSPOPINT;
970 case SAVEt_IV: /* IV reference */
972 *(IV*)ptr = (IV)SSPOPIV;
976 (void)sv_clear((SV*)gv);
978 case SAVEt_DESTRUCTOR:
982 case SAVEt_COP_ARYBASE:
985 CopARYBASE_set((COP *)ptr, i);
989 const struct re_save_state *const state
990 = (struct re_save_state *)
991 (PL_savestack + PL_savestack_ix
992 - SAVESTACK_ALLOC_FOR_RE_SAVE_STATE);
993 PL_savestack_ix -= SAVESTACK_ALLOC_FOR_RE_SAVE_STATE;
995 if (PL_reg_start_tmp != state->re_state_reg_start_tmp) {
996 Safefree(PL_reg_start_tmp);
998 if (PL_reg_poscache != state->re_state_reg_poscache) {
999 Safefree(PL_reg_poscache);
1001 Copy(state, &PL_reg_state, 1, struct re_save_state);
1005 Perl_croak(aTHX_ "panic: leave_scope inconsistency");
1011 Perl_cx_dump(pTHX_ PERL_CONTEXT *cx)
1015 PerlIO_printf(Perl_debug_log, "CX %ld = %s\n", (long)(cx - cxstack), PL_block_type[CxTYPE(cx)]);
1016 if (CxTYPE(cx) != CXt_SUBST) {
1017 PerlIO_printf(Perl_debug_log, "BLK_OLDSP = %ld\n", (long)cx->blk_oldsp);
1018 PerlIO_printf(Perl_debug_log, "BLK_OLDCOP = 0x%"UVxf"\n",
1019 PTR2UV(cx->blk_oldcop));
1020 PerlIO_printf(Perl_debug_log, "BLK_OLDMARKSP = %ld\n", (long)cx->blk_oldmarksp);
1021 PerlIO_printf(Perl_debug_log, "BLK_OLDSCOPESP = %ld\n", (long)cx->blk_oldscopesp);
1022 PerlIO_printf(Perl_debug_log, "BLK_OLDPM = 0x%"UVxf"\n",
1023 PTR2UV(cx->blk_oldpm));
1024 PerlIO_printf(Perl_debug_log, "BLK_GIMME = %s\n", cx->blk_gimme ? "LIST" : "SCALAR");
1026 switch (CxTYPE(cx)) {
1031 PerlIO_printf(Perl_debug_log, "BLK_SUB.CV = 0x%"UVxf"\n",
1032 PTR2UV(cx->blk_sub.cv));
1033 PerlIO_printf(Perl_debug_log, "BLK_SUB.GV = 0x%"UVxf"\n",
1034 PTR2UV(cx->blk_sub.gv));
1035 PerlIO_printf(Perl_debug_log, "BLK_SUB.DFOUTGV = 0x%"UVxf"\n",
1036 PTR2UV(cx->blk_sub.dfoutgv));
1037 PerlIO_printf(Perl_debug_log, "BLK_SUB.HASARGS = %d\n",
1038 (int)cx->blk_sub.hasargs);
1039 PerlIO_printf(Perl_debug_log, "BLK_SUB.RETOP = 0x%"UVxf"\n",
1040 PTR2UV(cx->blk_sub.retop));
1043 PerlIO_printf(Perl_debug_log, "BLK_SUB.CV = 0x%"UVxf"\n",
1044 PTR2UV(cx->blk_sub.cv));
1045 PerlIO_printf(Perl_debug_log, "BLK_SUB.OLDDEPTH = %ld\n",
1046 (long)cx->blk_sub.olddepth);
1047 PerlIO_printf(Perl_debug_log, "BLK_SUB.HASARGS = %d\n",
1048 (int)cx->blk_sub.hasargs);
1049 PerlIO_printf(Perl_debug_log, "BLK_SUB.LVAL = %d\n",
1050 (int)cx->blk_sub.lval);
1051 PerlIO_printf(Perl_debug_log, "BLK_SUB.RETOP = 0x%"UVxf"\n",
1052 PTR2UV(cx->blk_sub.retop));
1055 PerlIO_printf(Perl_debug_log, "BLK_EVAL.OLD_IN_EVAL = %ld\n",
1056 (long)cx->blk_eval.old_in_eval);
1057 PerlIO_printf(Perl_debug_log, "BLK_EVAL.OLD_OP_TYPE = %s (%s)\n",
1058 PL_op_name[cx->blk_eval.old_op_type],
1059 PL_op_desc[cx->blk_eval.old_op_type]);
1060 if (cx->blk_eval.old_namesv)
1061 PerlIO_printf(Perl_debug_log, "BLK_EVAL.OLD_NAME = %s\n",
1062 SvPVX_const(cx->blk_eval.old_namesv));
1063 PerlIO_printf(Perl_debug_log, "BLK_EVAL.OLD_EVAL_ROOT = 0x%"UVxf"\n",
1064 PTR2UV(cx->blk_eval.old_eval_root));
1065 PerlIO_printf(Perl_debug_log, "BLK_EVAL.RETOP = 0x%"UVxf"\n",
1066 PTR2UV(cx->blk_eval.retop));
1070 PerlIO_printf(Perl_debug_log, "BLK_LOOP.LABEL = %s\n",
1071 cx->blk_loop.label);
1072 PerlIO_printf(Perl_debug_log, "BLK_LOOP.RESETSP = %ld\n",
1073 (long)cx->blk_loop.resetsp);
1074 PerlIO_printf(Perl_debug_log, "BLK_LOOP.REDO_OP = 0x%"UVxf"\n",
1075 PTR2UV(cx->blk_loop.redo_op));
1076 PerlIO_printf(Perl_debug_log, "BLK_LOOP.NEXT_OP = 0x%"UVxf"\n",
1077 PTR2UV(cx->blk_loop.next_op));
1078 PerlIO_printf(Perl_debug_log, "BLK_LOOP.LAST_OP = 0x%"UVxf"\n",
1079 PTR2UV(cx->blk_loop.last_op));
1080 PerlIO_printf(Perl_debug_log, "BLK_LOOP.ITERIX = %ld\n",
1081 (long)cx->blk_loop.iterix);
1082 PerlIO_printf(Perl_debug_log, "BLK_LOOP.ITERARY = 0x%"UVxf"\n",
1083 PTR2UV(cx->blk_loop.iterary));
1084 PerlIO_printf(Perl_debug_log, "BLK_LOOP.ITERVAR = 0x%"UVxf"\n",
1085 PTR2UV(CxITERVAR(cx)));
1087 PerlIO_printf(Perl_debug_log, "BLK_LOOP.ITERSAVE = 0x%"UVxf"\n",
1088 PTR2UV(cx->blk_loop.itersave));
1089 PerlIO_printf(Perl_debug_log, "BLK_LOOP.ITERLVAL = 0x%"UVxf"\n",
1090 PTR2UV(cx->blk_loop.iterlval));
1094 PerlIO_printf(Perl_debug_log, "SB_ITERS = %ld\n",
1095 (long)cx->sb_iters);
1096 PerlIO_printf(Perl_debug_log, "SB_MAXITERS = %ld\n",
1097 (long)cx->sb_maxiters);
1098 PerlIO_printf(Perl_debug_log, "SB_RFLAGS = %ld\n",
1099 (long)cx->sb_rflags);
1100 PerlIO_printf(Perl_debug_log, "SB_ONCE = %ld\n",
1102 PerlIO_printf(Perl_debug_log, "SB_ORIG = %s\n",
1104 PerlIO_printf(Perl_debug_log, "SB_DSTR = 0x%"UVxf"\n",
1105 PTR2UV(cx->sb_dstr));
1106 PerlIO_printf(Perl_debug_log, "SB_TARG = 0x%"UVxf"\n",
1107 PTR2UV(cx->sb_targ));
1108 PerlIO_printf(Perl_debug_log, "SB_S = 0x%"UVxf"\n",
1110 PerlIO_printf(Perl_debug_log, "SB_M = 0x%"UVxf"\n",
1112 PerlIO_printf(Perl_debug_log, "SB_STREND = 0x%"UVxf"\n",
1113 PTR2UV(cx->sb_strend));
1114 PerlIO_printf(Perl_debug_log, "SB_RXRES = 0x%"UVxf"\n",
1115 PTR2UV(cx->sb_rxres));
1119 PERL_UNUSED_CONTEXT;
1120 PERL_UNUSED_ARG(cx);
1121 #endif /* DEBUGGING */
1126 * c-indentation-style: bsd
1128 * indent-tabs-mode: t
1131 * ex: set ts=8 sts=4 sw=4 noet: