X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=scope.h;h=bb033e369b9dee4165d052f77ed7d554c91754e4;hb=0642d82a230efbe169e4a441b6943c36ff880a90;hp=772eb41bd6b59fa327a4692cf17707b9516c4416;hpb=1ade1aa1ca2b2fe7e0085ec2cd022693e0d7a0d6;p=p5sagit%2Fp5-mst-13.2.git diff --git a/scope.h b/scope.h index 772eb41..bb033e3 100644 --- a/scope.h +++ b/scope.h @@ -1,7 +1,7 @@ /* scope.h * * Copyright (C) 1993, 1994, 1996, 1997, 1998, 1999, - * 2000, 2001, 2002, 2004, 2005 by Larry Wall and others + * 2000, 2001, 2002, 2004, 2005, 2006, 2007 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. @@ -43,7 +43,7 @@ #define SAVEt_I8 32 #define SAVEt_COMPPAD 33 #define SAVEt_GENERIC_PVREF 34 -#define SAVEt_PADSV 35 +#define SAVEt_PADSV_AND_MORTALIZE 35 #define SAVEt_MORTALIZESV 36 #define SAVEt_SHARED_PVREF 37 #define SAVEt_BOOL 38 @@ -51,13 +51,16 @@ #define SAVEt_SAVESWITCHSTACK 40 #define SAVEt_COP_ARYBASE 41 #define SAVEt_RE_STATE 42 +#define SAVEt_COMPILE_WARNINGS 43 +#define SAVEt_STACK_CXPOS 44 +#define SAVEt_PARSER 45 #ifndef SCOPE_SAVES_SIGNAL_MASK #define SCOPE_SAVES_SIGNAL_MASK 0 #endif -#define SSCHECK(need) if (PL_savestack_ix + (need) > PL_savestack_max) savestack_grow() -#define SSGROW(need) if (PL_savestack_ix + (need) > PL_savestack_max) savestack_grow_cnt(need) +#define SSCHECK(need) if (PL_savestack_ix + (I32)(need) > PL_savestack_max) savestack_grow() +#define SSGROW(need) if (PL_savestack_ix + (I32)(need) > PL_savestack_max) savestack_grow_cnt(need) #define SSPUSHINT(i) (PL_savestack[PL_savestack_ix++].any_i32 = (I32)(i)) #define SSPUSHLONG(i) (PL_savestack[PL_savestack_ix++].any_long = (long)(i)) #define SSPUSHBOOL(p) (PL_savestack[PL_savestack_ix++].any_bool = (p)) @@ -123,7 +126,7 @@ Closing bracket on a callback. See C and L. #define SAVESPTR(s) save_sptr((SV**)&(s)) #define SAVEPPTR(s) save_pptr((char**)&(s)) #define SAVEVPTR(s) save_vptr((void*)&(s)) -#define SAVEPADSV(s) save_padsv(s) +#define SAVEPADSVANDMORTALIZE(s) save_padsv_and_mortalize(s) #define SAVEFREESV(s) save_freesv((SV*)(s)) #define SAVEMORTALIZESV(s) save_mortalizesv((SV*)(s)) #define SAVEFREEOP(o) save_freeop((OP*)(o)) @@ -157,10 +160,12 @@ Closing bracket on a callback. See C and L. SSPUSHPTR(GvHV(PL_hintgv)); \ GvHV(PL_hintgv) = Perl_hv_copy_hints_hv(aTHX_ GvHV(PL_hintgv)); \ } \ - if (PL_compiling.cop_hints) { \ - PL_compiling.cop_hints->refcounted_he_refcnt++; \ + if (PL_compiling.cop_hints_hash) { \ + HINTS_REFCNT_LOCK; \ + PL_compiling.cop_hints_hash->refcounted_he_refcnt++; \ + HINTS_REFCNT_UNLOCK; \ } \ - SSPUSHPTR(PL_compiling.cop_hints); \ + SSPUSHPTR(PL_compiling.cop_hints_hash); \ SSPUSHINT(PL_hints); \ SSPUSHINT(SAVEt_HINTS); \ } STMT_END @@ -190,6 +195,32 @@ Closing bracket on a callback. See C and L. SSPUSHINT(SAVEt_COP_ARYBASE); \ } STMT_END +/* Need to do the cop warnings like this, rather than a "SAVEFREESHAREDPV", + because realloc() means that the value can actually change. Possibly + could have done savefreesharedpvREF, but this way actually seems cleaner, + as it simplifies the code that does the saves, and reduces the load on the + save stack. */ +#define SAVECOMPILEWARNINGS() \ + STMT_START { \ + SSCHECK(2); \ + SSPUSHPTR(PL_compiling.cop_warnings); \ + SSPUSHINT(SAVEt_COMPILE_WARNINGS); \ + } STMT_END + +#define SAVESTACK_CXPOS() \ + STMT_START { \ + SSCHECK(3); \ + SSPUSHINT(cxstack[cxstack_ix].blk_oldsp); \ + SSPUSHINT(cxstack_ix); \ + SSPUSHINT(SAVEt_STACK_CXPOS); \ + } STMT_END + +#define SAVEPARSER(p) \ + STMT_START { \ + SSCHECK(2); \ + SSPUSHPTR(p); \ + SSPUSHINT(SAVEt_PARSER); \ + } STMT_END #ifdef USE_ITHREADS # define SAVECOPSTASH(c) SAVEPPTR(CopSTASHPV(c)) @@ -225,3 +256,12 @@ Closing bracket on a callback. See C and L. #define SSPTR(off,type) ((type) ((char*)PL_savestack + off)) #define SSPTRt(off,type) ((type*) ((char*)PL_savestack + off)) +/* + * Local variables: + * c-indentation-style: bsd + * c-basic-offset: 4 + * indent-tabs-mode: t + * End: + * + * ex: set ts=8 sts=4 sw=4 noet: + */