diff options
author | Nicholas Clark <nick@ccl4.org> | 2008-01-20 19:56:21 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2008-01-20 19:56:21 +0000 |
commit | f9c764c5b8dcfa74adde8337ee9a5db227b55f56 (patch) | |
tree | 3bef743c1500b5191940af9dffa587e8a719f819 /cop.h | |
parent | c2d565bf20398393b9b05727867496686647584f (diff) | |
download | perl-f9c764c5b8dcfa74adde8337ee9a5db227b55f56.tar.gz |
Split struct block_sub into struct block_sub and struct block_format.
(CXt_SUB and CXt_FORMAT were using some comon members, but some members
were only for one or the other.)
p4raw-id: //depot/perl@33014
Diffstat (limited to 'cop.h')
-rw-r--r-- | cop.h | 37 |
1 files changed, 25 insertions, 12 deletions
@@ -280,15 +280,26 @@ struct cop { /* subroutine context */ struct block_sub { CV * cv; - GV * gv; - GV * dfoutgv; + OP * retop; /* op to execute on exit from sub */ + U8 hasargs; + U8 lval; /* XXX merge lval and hasargs? */ + /* Above here is the same for sub and format. */ AV * savearray; AV * argarray; I32 olddepth; - U8 hasargs; - U8 lval; /* XXX merge lval and hasargs? */ PAD *oldcomppad; +}; + + +/* format context */ +struct block_format { + CV * cv; OP * retop; /* op to execute on exit from sub */ + U8 hasargs; + U8 lval; /* XXX merge lval and hasargs? */ + /* Above here is the same for sub and format. */ + GV * gv; + GV * dfoutgv; }; /* base for the next two macros. Don't use directly. @@ -323,12 +334,12 @@ struct block_sub { #define PUSHFORMAT(cx, retop) \ - cx->blk_sub.cv = cv; \ - cx->blk_sub.gv = gv; \ - cx->blk_sub.retop = (retop); \ - cx->blk_sub.hasargs = 0; \ - cx->blk_sub.dfoutgv = PL_defoutgv; \ - SvREFCNT_inc_void(cx->blk_sub.dfoutgv) + cx->blk_format.cv = cv; \ + cx->blk_format.gv = gv; \ + cx->blk_format.retop = (retop); \ + cx->blk_format.hasargs = 0; \ + cx->blk_format.dfoutgv = PL_defoutgv; \ + SvREFCNT_inc_void(cx->blk_format.dfoutgv) #define POP_SAVEARRAY() \ STMT_START { \ @@ -378,8 +389,8 @@ struct block_sub { } STMT_END #define POPFORMAT(cx) \ - setdefout(cx->blk_sub.dfoutgv); \ - SvREFCNT_dec(cx->blk_sub.dfoutgv); + setdefout(cx->blk_format.dfoutgv); \ + SvREFCNT_dec(cx->blk_format.dfoutgv); /* eval context */ struct block_eval { @@ -532,6 +543,7 @@ struct block { union { struct block_sub blku_sub; + struct block_format blku_format; struct block_eval blku_eval; struct block_loop blku_loop; struct block_givwhen blku_givwhen; @@ -544,6 +556,7 @@ struct block { #define blk_oldpm cx_u.cx_blk.blku_oldpm #define blk_gimme cx_u.cx_blk.blku_gimme #define blk_sub cx_u.cx_blk.blk_u.blku_sub +#define blk_format cx_u.cx_blk.blk_u.blku_format #define blk_eval cx_u.cx_blk.blk_u.blku_eval #define blk_loop cx_u.cx_blk.blk_u.blku_loop #define blk_givwhen cx_u.cx_blk.blk_u.blku_givwhen |