X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=pad.c;h=3ab7497301ecb84244e78c019eefe3a3cb56a6d3;hb=6136c704e4e88f5381eda30a0d872d75aa9b9d11;hp=7fb8921cc44ecc328b3d569e463b7d883aa1177e;hpb=7d49f6898e172f330a81e972c5944fc5726fcbf3;p=p5sagit%2Fp5-mst-13.2.git diff --git a/pad.c b/pad.c index 7fb8921..3ab7497 100644 --- a/pad.c +++ b/pad.c @@ -1,6 +1,6 @@ /* pad.c * - * Copyright (C) 2002, 2003, 2004, 2005 by Larry Wall and others + * Copyright (C) 2002, 2003, 2004, 2005, 2006, by Larry Wall and others * * You may distribute under the terms of either the GNU General Public * License or the Artistic License, as specified in the README file. @@ -132,6 +132,7 @@ can be OR'ed together: PADLIST * Perl_pad_new(pTHX_ int flags) { + dVAR; AV *padlist, *padname, *pad; ASSERT_CURPAD_LEGAL("pad_new"); @@ -228,6 +229,7 @@ taken) void Perl_pad_undef(pTHX_ CV* cv) { + dVAR; I32 ix; const PADLIST * const padlist = CvPADLIST(cv); @@ -329,6 +331,7 @@ If fake, it means we're cloning an existing entry PADOFFSET Perl_pad_add_name(pTHX_ const char *name, HV* typestash, HV* ourstash, bool fake) { + dVAR; const PADOFFSET offset = pad_alloc(OP_PADSV, SVs_PADMY); SV* const namesv = NEWSV(1102, 0); @@ -404,9 +407,11 @@ for a slot which has no name and no active value. PADOFFSET Perl_pad_alloc(pTHX_ I32 optype, U32 tmptype) { + dVAR; SV *sv; I32 retval; + PERL_UNUSED_ARG(optype); ASSERT_CURPAD_ACTIVE("pad_alloc"); if (AvARRAY(PL_comppad) != PL_curpad) @@ -462,6 +467,7 @@ Add an anon code entry to the current compiling pad PADOFFSET Perl_pad_add_anon(pTHX_ SV* sv, OPCODE op_type) { + dVAR; PADOFFSET ix; SV* const name = NEWSV(1106, 0); sv_upgrade(name, SVt_PVNV); @@ -503,6 +509,7 @@ C indicates that the name to check is an 'our' declaration void Perl_pad_check_dup(pTHX_ const char *name, bool is_our, const HV *ourstash) { + dVAR; SV **svp; PADOFFSET top, off; @@ -572,6 +579,7 @@ Returns the offset in the current pad, or NOT_IN_PAD on failure. PADOFFSET Perl_pad_findmy(pTHX_ const char *name) { + dVAR; SV *out_sv; int out_flags; I32 offset; @@ -610,6 +618,7 @@ Perl_pad_findmy(pTHX_ const char *name) PADOFFSET Perl_find_rundefsvoffset(pTHX) { + dVAR; SV *out_sv; int out_flags; return pad_findlex("$_", find_runcv(NULL), PL_curcop->cop_seq, 1, @@ -656,6 +665,7 @@ STATIC PADOFFSET S_pad_findlex(pTHX_ const char *name, const CV* cv, U32 seq, int warn, SV** out_capture, SV** out_name_sv, int *out_flags) { + dVAR; I32 offset, new_offset; SV *new_capture; SV **new_capturep; @@ -827,9 +837,9 @@ S_pad_findlex(pTHX_ const char *name, const CV* cv, U32 seq, int warn, new_offset = pad_add_name( SvPVX_const(*out_name_sv), (SvFLAGS(*out_name_sv) & SVpad_TYPED) - ? SvSTASH(*out_name_sv) : Nullhv, + ? SvSTASH(*out_name_sv) : NULL, (SvFLAGS(*out_name_sv) & SVpad_OUR) - ? GvSTASH(*out_name_sv) : Nullhv, + ? GvSTASH(*out_name_sv) : NULL, 1 /* fake */ ); @@ -877,6 +887,7 @@ Use macro PAD_SV instead of calling this function directly. SV * Perl_pad_sv(pTHX_ PADOFFSET po) { + dVAR; ASSERT_CURPAD_ACTIVE("pad_sv"); if (!po) @@ -901,6 +912,7 @@ Use the macro PAD_SETSV() rather than calling this function directly. void Perl_pad_setsv(pTHX_ PADOFFSET po, SV* sv) { + dVAR; ASSERT_CURPAD_ACTIVE("pad_setsv"); DEBUG_X(PerlIO_printf(Perl_debug_log, @@ -930,6 +942,7 @@ Update the pad compilation state variables on entry to a new block void Perl_pad_block_start(pTHX_ int full) { + dVAR; ASSERT_CURPAD_ACTIVE("pad_block_start"); SAVEI32(PL_comppad_name_floor); PL_comppad_name_floor = AvFILLp(PL_comppad_name); @@ -958,6 +971,7 @@ Perl_pad_block_start(pTHX_ int full) U32 Perl_intro_my(pTHX) { + dVAR; SV **svp; I32 i; @@ -999,6 +1013,7 @@ lexicals in this scope and warn of any lexicals that never got introduced. void Perl_pad_leavemy(pTHX) { + dVAR; I32 off; SV * const * const svp = AvARRAY(PL_comppad_name); @@ -1044,6 +1059,7 @@ new one. void Perl_pad_swipe(pTHX_ PADOFFSET po, bool refadjust) { + dVAR; ASSERT_CURPAD_LEGAL("pad_swipe"); if (!PL_curpad) return; @@ -1092,6 +1108,7 @@ Mark all the current temporaries for reuse void Perl_pad_reset(pTHX) { + dVAR; #ifdef USE_BROKEN_PAD_RESET if (AvARRAY(PL_comppad) != PL_curpad) Perl_croak(aTHX_ "panic: pad_reset curpad"); @@ -1230,6 +1247,7 @@ Free the SV at offset po in the current pad. void Perl_pad_free(pTHX_ PADOFFSET po) { + dVAR; ASSERT_CURPAD_LEGAL("pad_free"); if (!PL_curpad) return; @@ -1274,6 +1292,7 @@ Dump the contents of a padlist void Perl_do_dump_pad(pTHX_ I32 level, PerlIO *file, PADLIST *padlist, int full) { + dVAR; const AV *pad_name; const AV *pad; SV **pname; @@ -1345,6 +1364,7 @@ dump the contents of a CV STATIC void S_cv_dump(pTHX_ const CV *cv, const char *title) { + dVAR; const CV * const outside = CvOUTSIDE(cv); AV* const padlist = CvPADLIST(cv); @@ -1536,6 +1556,7 @@ moved to a pre-existing CV struct. void Perl_pad_fixup_inner_anons(pTHX_ PADLIST *padlist, CV *old_cv, CV *new_cv) { + dVAR; I32 ix; AV * const comppad_name = (AV*)AvARRAY(padlist)[0]; AV * const comppad = (AV*)AvARRAY(padlist)[1]; @@ -1568,6 +1589,7 @@ the new pad an @_ in slot zero. void Perl_pad_push(pTHX_ PADLIST *padlist, int depth) { + dVAR; if (depth <= AvFILLp(padlist)) return; @@ -1623,11 +1645,12 @@ Perl_pad_push(pTHX_ PADLIST *padlist, int depth) HV * Perl_pad_compname_type(pTHX_ const PADOFFSET po) { + dVAR; SV* const * const av = av_fetch(PL_comppad_name, po, FALSE); if ( SvFLAGS(*av) & SVpad_TYPED ) { return SvSTASH(*av); } - return Nullhv; + return NULL; } /*