* The context frame holds a reference to the CV so that it can't be
* freed while we're executing it */
-#define PUSHSUB_BASE(cx, cv, op, hasargs) \
+#define CX_PUSHSUB_BASE(cx, cv, op, hasargs) \
ENTRY_PROBE(CvNAMED(cv) \
? HEK_KEY(CvNAME_HEK(cv)) \
: GvENAME(CvGV(cv)), \
cx->blk_sub.retop = op; \
SvREFCNT_inc_simple_void_NN(cv);
-#define PUSHSUB_GET_LVALUE_MASK(func) \
+#define CX_PUSHSUB_GET_LVALUE_MASK(func) \
/* If the context is indeterminate, then only the lvalue */ \
/* flags that the caller also has are applicable. */ \
( \
? 0 : (U8)func(aTHX) \
)
-#define PUSHSUB(cx, cv, op, hasargs) \
+#define CX_PUSHSUB(cx, cv, op, hasargs) \
{ \
- U8 phlags = PUSHSUB_GET_LVALUE_MASK(Perl_was_lvalue_sub); \
- PUSHSUB_BASE(cx, cv, op, hasargs) \
+ U8 phlags = CX_PUSHSUB_GET_LVALUE_MASK(Perl_was_lvalue_sub); \
+ CX_PUSHSUB_BASE(cx, cv, op, hasargs) \
cx->blk_u16 = PL_op->op_private & \
(phlags|OPpDEREF); \
}
/* variant for use by OP_DBSTATE, where op_private holds hint bits */
-#define PUSHSUB_DB(cx, cv, op, hasargs) \
- PUSHSUB_BASE(cx, cv, op, hasargs) \
+#define CX_PUSHSUB_DB(cx, cv, op, hasargs) \
+ CX_PUSHSUB_BASE(cx, cv, op, hasargs) \
cx->blk_u16 = 0;
-#define PUSHFORMAT(cx, cv, gv, retop) \
+#define CX_PUSHFORMAT(cx, cv, gv, retop) \
cx->blk_format.cv = cv; \
cx->blk_format.gv = gv; \
cx->blk_format.retop = (retop); \
#define CxOLD_IN_EVAL(cx) (((cx)->blk_u16) & 0x7F)
#define CxOLD_OP_TYPE(cx) (((cx)->blk_u16) >> 7)
-#define PUSHEVAL(cx, op, n) \
+#define CX_PUSHEVAL(cx, op, n) \
STMT_START { \
assert(!(PL_in_eval & ~0x7F)); \
assert(!(PL_op->op_type & ~0x1FF)); \
#define CxLVAL(c) (0 + ((c)->blk_u16 & 0xff))
-#define PUSHLOOP_PLAIN(cx) \
+#define CX_PUSHLOOP_PLAIN(cx) \
cx->blk_loop.my_op = cLOOP;
#ifdef USE_ITHREADS
-# define PUSHLOOP_FOR_setpad(c) (c)->blk_loop.oldcomppad = PL_comppad
+# define CX_PUSHLOOP_FOR_setpad(c) (c)->blk_loop.oldcomppad = PL_comppad
#else
-# define PUSHLOOP_FOR_setpad(c) NOOP
+# define CX_PUSHLOOP_FOR_setpad(c) NOOP
#endif
-#define PUSHLOOP_FOR(cx, ivar, isave) \
- PUSHLOOP_PLAIN(cx); \
+#define CX_PUSHLOOP_FOR(cx, ivar, isave) \
+ CX_PUSHLOOP_PLAIN(cx); \
cx->blk_loop.itervar_u.svp = (SV**)(ivar); \
cx->blk_loop.itersave = isave; \
- PUSHLOOP_FOR_setpad(cx);
+ CX_PUSHLOOP_FOR_setpad(cx);
#define CX_POPLOOP(cx) \
assert(CxTYPE_is_LOOP(cx)); \
SV *defsv_save; /* the original $_ */
};
-#define PUSHWHEN(cx) \
+#define CX_PUSHWHEN(cx) \
cx->blk_givwhen.leave_op = cLOGOP->op_other;
-#define PUSHGIVEN(cx, orig_var) \
- PUSHWHEN(cx); \
+#define CX_PUSHGIVEN(cx, orig_var) \
+ CX_PUSHWHEN(cx); \
cx->blk_givwhen.defsv_save = orig_var;
#define CX_POPWHEN(cx) \
__FILE__, __LINE__));
/* Enter a block. */
-#define PUSHBLOCK(cx, t, gimme, sp, saveix) \
+#define CX_PUSHBLOCK(cx, t, gimme, sp, saveix) \
CXINC, \
cx = CX_CUR(), \
cx->cx_type = t, \
#define sb_rx cx_u.cx_subst.sbu_rx
#ifdef PERL_CORE
-# define PUSHSUBST(cx) CXINC, cx = CX_CUR(), \
+# define CX_PUSHSUBST(cx) CXINC, cx = CX_CUR(), \
cx->blk_oldsaveix = oldsave, \
cx->sb_iters = iters, \
cx->sb_maxiters = maxiters, \
OP *multicall_cop; \
bool multicall_oldcatch; \
I32 saveix_floor; \
- U8 hasargs = 0 /* used by PUSHSUB */
+ U8 hasargs = 0 /* used by CX_PUSHSUB */
#define PUSH_MULTICALL(the_cv) \
PUSH_MULTICALL_FLAGS(the_cv, 0)
multicall_oldcatch = CATCH_GET; \
CATCH_SET(TRUE); \
PUSHSTACKi(PERLSI_MULTICALL); \
- PUSHBLOCK(cx, (CXt_SUB|CXp_MULTICALL|flags), gimme, \
+ CX_PUSHBLOCK(cx, (CXt_SUB|CXp_MULTICALL|flags), gimme, \
PL_stack_sp, PL_savestack_ix); \
- PUSHSUB(cx, cv, NULL, hasargs); \
+ CX_PUSHSUB(cx, cv, NULL, hasargs); \
SAVEOP(); \
saveix_floor = PL_savestack_ix; \
if (!(flags & CXp_SUB_RE_FAKE)) \
assert(CxMULTICALL(cx)); \
CX_POPSUB_COMMON(cx); \
cx->cx_type = (CXt_SUB|CXp_MULTICALL|flags); \
- PUSHSUB(cx, cv, NULL, hasargs); \
+ CX_PUSHSUB(cx, cv, NULL, hasargs); \
if (!(flags & CXp_SUB_RE_FAKE)) \
CvDEPTH(cv)++; \
if (CvDEPTH(cv) >= 2) \
U8 op_private;
#endif
-/* If op_type:9 is changed to :10, also change PUSHEVAL in cop.h.
+/* If op_type:9 is changed to :10, also change CX_PUSHEVAL in cop.h.
Also, if the type of op_type is ever changed (e.g. to PERL_BITFIELD32)
then all the other bit-fields before/after it should change their
types too to let VC pack them into the same 4 byte integer.*/
myop.op_private = (OPpEVAL_COPHH | OPpEVAL_RE_REPARSING);
/* fail now; otherwise we could fail after the JMPENV_PUSH but
- * before a PUSHEVAL, which corrupts the stack after a croak */
+ * before a CX_PUSHEVAL, which corrupts the stack after a croak */
TAINT_PROPER("eval_sv()");
JMPENV_PUSH(ret);
return 0;
}
-/* only used by PUSHSUB */
+/* only used by CX_PUSHSUB */
I32
Perl_was_lvalue_sub(pTHX)
{
return NORMAL;
}
else {
- PUSHBLOCK(cx, CXt_SUB, gimme, SP, PL_savestack_ix);
- PUSHSUB_DB(cx, cv, PL_op->op_next, 0);
+ CX_PUSHBLOCK(cx, CXt_SUB, gimme, SP, PL_savestack_ix);
+ CX_PUSHSUB_DB(cx, cv, PL_op->op_next, 0);
SAVEI32(PL_debug);
PL_debug = 0;
PERL_CONTEXT *cx;
I32 gimme = GIMME_V;
- PUSHBLOCK(cx, CXt_BLOCK, gimme, SP, PL_savestack_ix);
+ CX_PUSHBLOCK(cx, CXt_BLOCK, gimme, SP, PL_savestack_ix);
RETURN;
}
* there mustn't be anything in the blk_loop substruct that requires
* freeing or undoing, in case we die in the meantime. And vice-versa.
*/
- PUSHBLOCK(cx, cxflags, gimme, MARK, PL_savestack_ix);
- PUSHLOOP_FOR(cx, itervarp, itersave);
+ CX_PUSHBLOCK(cx, cxflags, gimme, MARK, PL_savestack_ix);
+ CX_PUSHLOOP_FOR(cx, itervarp, itersave);
if (PL_op->op_flags & OPf_STACKED) {
/* OPf_STACKED implies either a single array: for(@), with a
PERL_CONTEXT *cx;
const I32 gimme = GIMME_V;
- PUSHBLOCK(cx, CXt_LOOP_PLAIN, gimme, SP, PL_savestack_ix);
- PUSHLOOP_PLAIN(cx);
+ CX_PUSHBLOCK(cx, CXt_LOOP_PLAIN, gimme, SP, PL_savestack_ix);
+ CX_PUSHLOOP_PLAIN(cx);
RETURN;
}
SAVEFREESV(cv); /* later, undo the 'avoid premature free' hack */
- /* partial unrolled PUSHSUB(): */
+ /* partial unrolled CX_PUSHSUB(): */
cx->blk_sub.cv = cv;
cx->blk_sub.olddepth = CvDEPTH(cv);
}
/* switch to eval mode */
- PUSHBLOCK(cx, CXt_EVAL, gimme, SP, old_savestack_ix);
- PUSHEVAL(cx, PL_op->op_next, newSVpv(name, 0));
+ CX_PUSHBLOCK(cx, CXt_EVAL, gimme, SP, old_savestack_ix);
+ CX_PUSHEVAL(cx, PL_op->op_next, newSVpv(name, 0));
SAVECOPLINE(&PL_compiling);
CopLINE_set(&PL_compiling, 0);
* to do the dirty work for us */
runcv = find_runcv(&seq);
- PUSHBLOCK(cx, (CXt_EVAL|CXp_REAL), gimme, SP, old_savestack_ix);
- PUSHEVAL(cx, PL_op->op_next, NULL);
+ CX_PUSHBLOCK(cx, (CXt_EVAL|CXp_REAL), gimme, SP, old_savestack_ix);
+ CX_PUSHEVAL(cx, PL_op->op_next, NULL);
/* prepare to compile string */
PERL_CONTEXT *cx;
const I32 gimme = GIMME_V;
- PUSHBLOCK(cx, (CXt_EVAL|CXp_TRYBLOCK), gimme, PL_stack_sp, PL_savestack_ix);
- PUSHEVAL(cx, retop, NULL);
+ CX_PUSHBLOCK(cx, (CXt_EVAL|CXp_TRYBLOCK), gimme,
+ PL_stack_sp, PL_savestack_ix);
+ CX_PUSHEVAL(cx, retop, NULL);
PL_in_eval = EVAL_INEVAL;
if (flags & G_KEEPERR)
assert(!PL_op->op_targ); /* used to be set for lexical $_ */
GvSV(PL_defgv) = SvREFCNT_inc(newsv);
- PUSHBLOCK(cx, CXt_GIVEN, gimme, SP, PL_savestack_ix);
- PUSHGIVEN(cx, origsv);
+ CX_PUSHBLOCK(cx, CXt_GIVEN, gimme, SP, PL_savestack_ix);
+ CX_PUSHGIVEN(cx, origsv);
RETURN;
}
if ((0 == (PL_op->op_flags & OPf_SPECIAL)) && !SvTRUEx(POPs))
RETURNOP(cLOGOP->op_other->op_next);
- PUSHBLOCK(cx, CXt_WHEN, gimme, SP, PL_savestack_ix);
- PUSHWHEN(cx);
+ CX_PUSHBLOCK(cx, CXt_WHEN, gimme, SP, PL_savestack_ix);
+ CX_PUSHWHEN(cx);
RETURN;
}
* searching for places in this sub that uses a particular var:
* iters maxiters r_flags oldsave rxtainted orig dstr targ
* s m strend rx once */
- PUSHSUBST(cx);
+ CX_PUSHSUBST(cx);
RETURNOP(cPMOP->op_pmreplrootu.op_pmreplroot);
}
first = TRUE;
}
/* At this point we want to save PL_savestack_ix, either by doing a
- * PUSHSUB, or for XS, doing an ENTER. But we don't yet know the final
+ * CX_PUSHSUB, or for XS, doing an ENTER. But we don't yet know the final
* CV we will be using (so we don't know whether its XS, so we can't
- * PUSHSUB or ENTER yet), and determining cv may itself push stuff on
+ * CX_PUSHSUB or ENTER yet), and determining cv may itself push stuff on
* the save stack. So remember where we are currently on the save
* stack, and later update the CX or scopestack entry accordingly. */
old_savestack_ix = PL_savestack_ix;
}
gimme = GIMME_V;
- PUSHBLOCK(cx, CXt_SUB, gimme, MARK, old_savestack_ix);
+ CX_PUSHBLOCK(cx, CXt_SUB, gimme, MARK, old_savestack_ix);
hasargs = cBOOL(PL_op->op_flags & OPf_STACKED);
- PUSHSUB(cx, cv, PL_op->op_next, hasargs);
+ CX_PUSHSUB(cx, cv, PL_op->op_next, hasargs);
padlist = CvPADLIST(cv);
if (UNLIKELY((depth = ++CvDEPTH(cv)) >= 2))
PUTBACK;
if (UNLIKELY(((PL_op->op_private
- & PUSHSUB_GET_LVALUE_MASK(Perl_is_lvalue_sub)
+ & CX_PUSHSUB_GET_LVALUE_MASK(Perl_is_lvalue_sub)
) & OPpENTERSUB_LVAL_MASK) == OPpLVAL_INTRO &&
!CvLVALUE(cv)))
DIE(aTHX_ "Can't modify non-lvalue subroutine call of &%"SVf,
}
gimme = G_SCALAR;
- PUSHBLOCK(cx, CXt_NULL, gimme, PL_stack_base, old_savestack_ix);
+ CX_PUSHBLOCK(cx, CXt_NULL, gimme, PL_stack_base, old_savestack_ix);
if (!(flags & OPf_SPECIAL)) {
cx->cx_type = CXt_SUB|CXp_MULTICALL;
- PUSHSUB(cx, cv, NULL, hasargs);
+ CX_PUSHSUB(cx, cv, NULL, hasargs);
if (!is_xsub) {
PADLIST * const padlist = CvPADLIST(cv);
if (CvCLONE(cv))
cv = MUTABLE_CV(sv_2mortal(MUTABLE_SV(cv_clone(cv))));
- PUSHBLOCK(cx, CXt_FORMAT, gimme, PL_stack_sp, PL_savestack_ix);
- PUSHFORMAT(cx, cv, gv, retop);
+ CX_PUSHBLOCK(cx, CXt_FORMAT, gimme, PL_stack_sp, PL_savestack_ix);
+ CX_PUSHFORMAT(cx, cv, gv, retop);
if (CvDEPTH(cv) >= 2)
pad_push(CvPADLIST(cv), CvDEPTH(cv));
PAD_SET_CUR_NOSAVE(CvPADLIST(cv), CvDEPTH(cv));
si->si_cxix = -1;
si->si_type = PERLSI_UNDEF;
Newx(si->si_cxstack, cxitems, PERL_CONTEXT);
- /* Without any kind of initialising PUSHSUBST()
+ /* Without any kind of initialising CX_PUSHSUBST()
* in pp_subst() will read uninitialised heap. */
PoisonNew(si->si_cxstack, cxitems, PERL_CONTEXT);
return si;