X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=cop.h;h=44305da95a72313f83fd79f3598e973323a87fb4;hb=b3c0ec7c1220f243dffb147d13728e1cc44420cc;hp=e6fbfe722019ef194d4ee00358e684aa1be94a9a;hpb=3db8f154c4c6e098a5a0bdf7932e8f86fbd2c451;p=p5sagit%2Fp5-mst-13.2.git diff --git a/cop.h b/cop.h index e6fbfe7..44305da 100644 --- a/cop.h +++ b/cop.h @@ -1,10 +1,16 @@ /* cop.h * - * Copyright (c) 1991-2002, Larry Wall + * Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, + * 2000, 2001, 2002, 2003, 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. * + * Control ops (cops) are one of the three ops OP_NEXTSTATE, OP_DBSTATE, + * and OP_SETSTATE that (loosely speaking) are separate statements. + * They hold information important for lexical state and error reporting. + * At run time, PL_curcop is set to point to the most recently executed cop, + * and thus can be used to determine our current state. */ struct cop { @@ -112,16 +118,26 @@ struct block_sub { long olddepth; U8 hasargs; U8 lval; /* XXX merge lval and hasargs? */ - PAD oldcurpad; + PAD *oldcomppad; }; -#define PUSHSUB(cx) \ +/* base for the next two macros. Don't use directly */ +#define PUSHSUB_BASE(cx) \ cx->blk_sub.cv = cv; \ cx->blk_sub.olddepth = CvDEPTH(cv); \ - cx->blk_sub.hasargs = hasargs; \ + cx->blk_sub.hasargs = hasargs; + +#define PUSHSUB(cx) \ + PUSHSUB_BASE(cx) \ cx->blk_sub.lval = PL_op->op_private & \ (OPpLVAL_INTRO|OPpENTERSUB_INARGS); +/* variant for use by OP_DBSTATE, where op_private holds hint bits */ +#define PUSHSUB_DB(cx) \ + PUSHSUB_BASE(cx) \ + cx->blk_sub.lval = 0; + + #define PUSHFORMAT(cx) \ cx->blk_sub.cv = cv; \ cx->blk_sub.gv = gv; \ @@ -214,7 +230,7 @@ struct block_loop { OP * last_op; #ifdef USE_ITHREADS void * iterdata; - PAD oldcurpad; + PAD *oldcomppad; #else SV ** itervar; #endif