summaryrefslogtreecommitdiff
path: root/cop.h
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2016-11-10 14:44:10 +0000
committerDavid Mitchell <davem@iabyn.com>2016-11-12 16:15:09 +0000
commit4c57ced57467061af9e672665cba30edd3391432 (patch)
tree2a3aad023851e220609e6aa3c79522d9124af3c0 /cop.h
parent8efda520355126b24fb7c81c753eb2028dcc43bd (diff)
downloadperl-4c57ced57467061af9e672665cba30edd3391432.tar.gz
remove eval's usage of SvSCREAM
Currently the SvSCREAM flag is set on the sv pointed to by cx->blk_eval.cur_text, to indicate that it is ref counted. Instead, use a spare bit in the blk_u16 field of the eval context. This is to reduce the number of odd special cases for the SvSCREAM flag.
Diffstat (limited to 'cop.h')
-rw-r--r--cop.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/cop.h b/cop.h
index b371379d70..0443e24c66 100644
--- a/cop.h
+++ b/cop.h
@@ -640,8 +640,11 @@ struct block_eval {
blku_gimme is actually also only 2 bits, so could be merged with something.
*/
-#define CxOLD_IN_EVAL(cx) (((cx)->blk_u16) & 0x7F)
-#define CxOLD_OP_TYPE(cx) (((cx)->blk_u16) >> 7)
+/* blk_u16 bit usage for eval contexts: */
+
+#define CxOLD_IN_EVAL(cx) (((cx)->blk_u16) & 0x3F) /* saved PL in_eval */
+#define CxEVAL_TXT_REFCNTED(cx) (((cx)->blk_u16) & 0x40) /* cur_text rc++ */
+#define CxOLD_OP_TYPE(cx) (((cx)->blk_u16) >> 7) /* type of eval op */
/* loop context */
struct block_loop {
@@ -961,6 +964,7 @@ L<perlcall>.
#define EVAL_KEEPERR 4 /* set by Perl_call_sv if G_KEEPERR */
#define EVAL_INREQUIRE 8 /* The code is being required. */
#define EVAL_RE_REPARSING 0x10 /* eval_sv() called with G_RE_REPARSING */
+/* if adding extra bits, make sure they can fit in CxOLD_OP_TYPE() */
/* Support for switching (stack and block) contexts.
* This ensures magic doesn't invalidate local stack and cx pointers.