Change 33030 by [EMAIL PROTECTED] on 2008/01/21 15:47:15
In struct block_eval, eliminate old_in_eval and old_op_type by storing
the data in blk_u16.
Affected files ...
... //depot/perl/cop.h#160 edit
... //depot/perl/op.h#203 edit
Differences ...
==== //depot/perl/cop.h#160 (text) ====
Index: perl/cop.h
--- perl/cop.h#159~33029~ 2008-01-21 07:14:35.000000000 -0800
+++ perl/cop.h 2008-01-21 07:47:15.000000000 -0800
@@ -393,8 +393,6 @@
struct block_eval {
OP * retop; /* op to execute on exit from eval */
/* Above here is the same for sub, format and eval. */
- U8 old_in_eval;
- U16 old_op_type;
SV * old_namesv;
OP * old_eval_root;
SV * cur_text;
@@ -402,13 +400,18 @@
JMPENV * cur_top_env; /* value of PL_top_env when eval CX created */
};
-#define CxOLD_IN_EVAL(cx) (0 + (cx)->blk_eval.old_in_eval)
-#define CxOLD_OP_TYPE(cx) (0 + (cx)->blk_eval.old_op_type)
+/* If we ever need more than 512 op types, change the shift from 7.
+ 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)
#define PUSHEVAL(cx,n,fgv) \
STMT_START { \
- cx->blk_eval.old_in_eval = PL_in_eval; \
- cx->blk_eval.old_op_type = PL_op->op_type; \
+ assert(!(PL_in_eval & ~0x7F)); \
+ assert(!(PL_op->op_type & ~0x1FF)); \
+ cx->blk_u16 = (PL_in_eval & 0x7F) | ((U16)PL_op->op_type << 7); \
cx->blk_eval.old_namesv = (n ? newSVpv(n,0) : NULL); \
cx->blk_eval.old_eval_root = PL_eval_root; \
cx->blk_eval.cur_text = PL_parser ? PL_parser->linestr : NULL; \
@@ -535,7 +538,7 @@
struct block {
U8 blku_type; /* what kind of context this is */
U8 blku_gimme; /* is this block running in list context? */
- U16 blku_u16; /* U16 of space used by block_sub */
+ U16 blku_u16; /* used by block_sub and block_eval (so
far) */
I32 blku_oldsp; /* stack pointer to copy stuff down to
*/
COP * blku_oldcop; /* old curcop pointer */
I32 blku_oldmarksp; /* mark stack index */
==== //depot/perl/op.h#203 (text) ====
Index: perl/op.h
--- perl/op.h#202~33025~ 2008-01-21 03:50:52.000000000 -0800
+++ perl/op.h 2008-01-21 07:47:15.000000000 -0800
@@ -64,6 +64,8 @@
U8 op_private;
#endif
+/* If op_type:9 is changed to :10, also change PUSHEVAL in cop.h */
+
#define OP_GIMME(op,dfl) \
(((op)->op_flags & OPf_WANT) == OPf_WANT_VOID ? G_VOID : \
((op)->op_flags & OPf_WANT) == OPf_WANT_SCALAR ? G_SCALAR : \
End of Patch.