Declares a local copy of perl's stack pointer for the XSUB, available via
the C<SP> macro. See C<L</SP>>.
Declares a local copy of perl's stack pointer for the XSUB, available via
the C<SP> macro. See C<L</SP>>.
Declare Just C<SP>. This is actually identical to C<dSP>, and declares
a local copy of perl's stack pointer, available via the C<SP> macro.
See C<L<perlapi/SP>>. (Available for backward source code compatibility with
the old (Perl 5.005) thread model.)
Declare Just C<SP>. This is actually identical to C<dSP>, and declares
a local copy of perl's stack pointer, available via the C<SP> macro.
See C<L<perlapi/SP>>. (Available for backward source code compatibility with
the old (Perl 5.005) thread model.)
Saves the original stack mark for the XSUB. See C<L</ORIGMARK>>.
=for apidoc AmnU||ORIGMARK
The original stack mark for the XSUB. See C<L</dORIGMARK>>.
Saves the original stack mark for the XSUB. See C<L</ORIGMARK>>.
=for apidoc AmnU||ORIGMARK
The original stack mark for the XSUB. See C<L</dORIGMARK>>.
*mark_stack_entry = (I32)((p) - PL_stack_base); \
DEBUG_s(DEBUG_v(PerlIO_printf(Perl_debug_log, \
"MARK push %p %" IVdf "\n", \
*mark_stack_entry = (I32)((p) - PL_stack_base); \
DEBUG_s(DEBUG_v(PerlIO_printf(Perl_debug_log, \
"MARK push %p %" IVdf "\n", \
#define dTARGET SV * GETTARGET
#define GETATARGET targ = (PL_op->op_flags & OPf_STACKED ? sp[-1] : PAD_SV(PL_op->op_targ))
#define dTARGET SV * GETTARGET
#define GETATARGET targ = (PL_op->op_flags & OPf_STACKED ? sp[-1] : PAD_SV(PL_op->op_targ))
Closing bracket for XSUB arguments. This is usually handled by C<xsubpp>.
See C<L</PUSHMARK>> and L<perlcall> for other uses.
Closing bracket for XSUB arguments. This is usually handled by C<xsubpp>.
See C<L</PUSHMARK>> and L<perlcall> for other uses.
call multiple C<TARG>-oriented macros to return lists from XSUB's - see
C<L</mPUSHp>> instead. See also C<L</XPUSHp>> and C<L</mXPUSHp>>.
call multiple C<TARG>-oriented macros to return lists from XSUB's - see
C<L</mPUSHp>> instead. See also C<L</XPUSHp>> and C<L</mXPUSHp>>.
=for apidoc Am|void|PUSHn|NV nv
Push a double onto the stack. The stack must have room for this element.
Handles 'set' magic. Uses C<TARG>, so C<dTARGET> or C<dXSTARG> should be
=for apidoc Am|void|PUSHn|NV nv
Push a double onto the stack. The stack must have room for this element.
Handles 'set' magic. Uses C<TARG>, so C<dTARGET> or C<dXSTARG> should be
multiple C<TARG>-oriented macros to return lists from XSUB's - see
C<L</mXPUSHp>> instead. See also C<L</PUSHp>> and C<L</mPUSHp>>.
multiple C<TARG>-oriented macros to return lists from XSUB's - see
C<L</mXPUSHp>> instead. See also C<L</PUSHp>> and C<L</mPUSHp>>.
=for apidoc Am|void|XPUSHn|NV nv
Push a double onto the stack, extending the stack if necessary. Handles
'set' magic. Uses C<TARG>, so C<dTARGET> or C<dXSTARG> should be called to
=for apidoc Am|void|XPUSHn|NV nv
Push a double onto the stack, extending the stack if necessary. Handles
'set' magic. Uses C<TARG>, so C<dTARGET> or C<dXSTARG> should be called to
The C<len> indicates the length of the string. Does not use C<TARG>.
See also C<L</PUSHp>>, C<L</mXPUSHp>> and C<L</XPUSHp>>.
The C<len> indicates the length of the string. Does not use C<TARG>.
See also C<L</PUSHp>>, C<L</mXPUSHp>> and C<L</XPUSHp>>.
=for apidoc Am|void|mPUSHn|NV nv
Push a double onto the stack. The stack must have room for this element.
Does not use C<TARG>. See also C<L</PUSHn>>, C<L</mXPUSHn>> and C<L</XPUSHn>>.
=for apidoc Am|void|mPUSHn|NV nv
Push a double onto the stack. The stack must have room for this element.
Does not use C<TARG>. See also C<L</PUSHn>>, C<L</mXPUSHn>> and C<L</XPUSHn>>.
indicates the length of the string. Does not use C<TARG>. See also
C<L</XPUSHp>>, C<mPUSHp> and C<PUSHp>.
indicates the length of the string. Does not use C<TARG>. See also
C<L</XPUSHp>>, C<mPUSHp> and C<PUSHp>.
=for apidoc Am|void|mXPUSHn|NV nv
Push a double onto the stack, extending the stack if necessary.
Does not use C<TARG>. See also C<L</XPUSHn>>, C<L</mPUSHn>> and C<L</PUSHn>>.
=for apidoc Am|void|mXPUSHn|NV nv
Push a double onto the stack, extending the stack if necessary.
Does not use C<TARG>. See also C<L</XPUSHn>>, C<L</mPUSHn>> and C<L</PUSHn>>.
* requested to be extended (which is likely to be less than PL_stack_max)
*/
#if defined DEBUGGING && !defined DEBUGGING_RE_ONLY
* requested to be extended (which is likely to be less than PL_stack_max)
*/
#if defined DEBUGGING && !defined DEBUGGING_RE_ONLY
-# define EXTEND_HWM_SET(p, n) \
- STMT_START { \
- SSize_t ix = (p) - PL_stack_base + (n); \
- if (ix > PL_curstackinfo->si_stack_hwm) \
- PL_curstackinfo->si_stack_hwm = ix; \
+# define EXTEND_HWM_SET(p, n) \
+ STMT_START { \
+ SSize_t extend_hwm_set_ix = (p) - PL_stack_base + (n); \
+ if (extend_hwm_set_ix > PL_curstackinfo->si_stack_hwm) \
+ PL_curstackinfo->si_stack_hwm = extend_hwm_set_ix; \
# define EXTEND_SKIP(p, n) STMT_START { \
EXTEND_HWM_SET(p, n); \
assert(!_EXTEND_NEEDS_GROW(p,n)); \
# define EXTEND_SKIP(p, n) STMT_START { \
EXTEND_HWM_SET(p, n); \
assert(!_EXTEND_NEEDS_GROW(p,n)); \
if (UNLIKELY(_EXTEND_NEEDS_GROW(p,n))) { \
sp = stack_grow(sp,p,_EXTEND_SAFE_N(n)); \
PERL_UNUSED_VAR(sp); \
if (UNLIKELY(_EXTEND_NEEDS_GROW(p,n))) { \
sp = stack_grow(sp,p,_EXTEND_SAFE_N(n)); \
PERL_UNUSED_VAR(sp); \
/* Same thing, but update mark register too. */
# define MEXTEND(p,n) STMT_START { \
EXTEND_HWM_SET(p, n); \
/* Same thing, but update mark register too. */
# define MEXTEND(p,n) STMT_START { \
EXTEND_HWM_SET(p, n); \
sp = stack_grow(sp,p,_EXTEND_SAFE_N(n)); \
mark = PL_stack_base + markoff; \
PERL_UNUSED_VAR(sp); \
sp = stack_grow(sp,p,_EXTEND_SAFE_N(n)); \
mark = PL_stack_base + markoff; \
PERL_UNUSED_VAR(sp); \
#define PUSHs(s) (*++sp = (s))
#define PUSHTARG STMT_START { SvSETMAGIC(TARG); PUSHs(TARG); } STMT_END
#define PUSHp(p,l) STMT_START { sv_setpvn(TARG, (p), (l)); PUSHTARG; } STMT_END
#define PUSHs(s) (*++sp = (s))
#define PUSHTARG STMT_START { SvSETMAGIC(TARG); PUSHs(TARG); } STMT_END
#define PUSHp(p,l) STMT_START { sv_setpvn(TARG, (p), (l)); PUSHTARG; } STMT_END
#define PUSHn(n) STMT_START { TARGn(n,1); PUSHs(TARG); } STMT_END
#define PUSHi(i) STMT_START { TARGi(i,1); PUSHs(TARG); } STMT_END
#define PUSHu(u) STMT_START { TARGu(u,1); PUSHs(TARG); } STMT_END
#define PUSHn(n) STMT_START { TARGn(n,1); PUSHs(TARG); } STMT_END
#define PUSHi(i) STMT_START { TARGi(i,1); PUSHs(TARG); } STMT_END
#define PUSHu(u) STMT_START { TARGu(u,1); PUSHs(TARG); } STMT_END
#define XPUSHs(s) STMT_START { EXTEND(sp,1); *++sp = (s); } STMT_END
#define XPUSHTARG STMT_START { SvSETMAGIC(TARG); XPUSHs(TARG); } STMT_END
#define XPUSHp(p,l) STMT_START { sv_setpvn(TARG, (p), (l)); XPUSHTARG; } STMT_END
#define XPUSHs(s) STMT_START { EXTEND(sp,1); *++sp = (s); } STMT_END
#define XPUSHTARG STMT_START { SvSETMAGIC(TARG); XPUSHs(TARG); } STMT_END
#define XPUSHp(p,l) STMT_START { sv_setpvn(TARG, (p), (l)); XPUSHTARG; } STMT_END
#define XPUSHn(n) STMT_START { TARGn(n,1); XPUSHs(TARG); } STMT_END
#define XPUSHi(i) STMT_START { TARGi(i,1); XPUSHs(TARG); } STMT_END
#define XPUSHu(u) STMT_START { TARGu(u,1); XPUSHs(TARG); } STMT_END
#define XPUSHn(n) STMT_START { TARGn(n,1); XPUSHs(TARG); } STMT_END
#define XPUSHi(i) STMT_START { TARGi(i,1); XPUSHs(TARG); } STMT_END
#define XPUSHu(u) STMT_START { TARGu(u,1); XPUSHs(TARG); } STMT_END
#define mPUSHs(s) PUSHs(sv_2mortal(s))
#define PUSHmortal PUSHs(sv_newmortal())
#define mPUSHp(p,l) PUSHs(newSVpvn_flags((p), (l), SVs_TEMP))
#define mPUSHs(s) PUSHs(sv_2mortal(s))
#define PUSHmortal PUSHs(sv_newmortal())
#define mPUSHp(p,l) PUSHs(newSVpvn_flags((p), (l), SVs_TEMP))
#define mPUSHn(n) sv_setnv(PUSHmortal, (NV)(n))
#define mPUSHi(i) sv_setiv(PUSHmortal, (IV)(i))
#define mPUSHu(u) sv_setuv(PUSHmortal, (UV)(u))
#define mPUSHn(n) sv_setnv(PUSHmortal, (NV)(n))
#define mPUSHi(i) sv_setiv(PUSHmortal, (IV)(i))
#define mPUSHu(u) sv_setuv(PUSHmortal, (UV)(u))
#define mXPUSHs(s) XPUSHs(sv_2mortal(s))
#define XPUSHmortal XPUSHs(sv_newmortal())
#define mXPUSHp(p,l) STMT_START { EXTEND(sp,1); mPUSHp((p), (l)); } STMT_END
#define mXPUSHs(s) XPUSHs(sv_2mortal(s))
#define XPUSHmortal XPUSHs(sv_newmortal())
#define mXPUSHp(p,l) STMT_START { EXTEND(sp,1); mPUSHp((p), (l)); } STMT_END
#define mXPUSHn(n) STMT_START { EXTEND(sp,1); mPUSHn(n); } STMT_END
#define mXPUSHi(i) STMT_START { EXTEND(sp,1); mPUSHi(i); } STMT_END
#define mXPUSHu(u) STMT_START { EXTEND(sp,1); mPUSHu(u); } STMT_END
#define mXPUSHn(n) STMT_START { EXTEND(sp,1); mPUSHn(n); } STMT_END
#define mXPUSHi(i) STMT_START { EXTEND(sp,1); mPUSHi(i); } STMT_END
#define mXPUSHu(u) STMT_START { EXTEND(sp,1); mPUSHu(u); } STMT_END
#define dPOPXiirl_ul_nomg(X) \
IV right = (sp--, SvIV_nomg(TOPp1s)); \
SV *leftsv = CAT2(X,s); \
#define dPOPXiirl_ul_nomg(X) \
IV right = (sp--, SvIV_nomg(TOPp1s)); \
SV *leftsv = CAT2(X,s); \
- AvFILLp(f) = sp - PL_stack_base; \
- PL_stack_base = AvARRAY(t); \
- PL_stack_max = PL_stack_base + AvMAX(t); \
- sp = PL_stack_sp = PL_stack_base + AvFILLp(t); \
- PL_curstack = t; \
+ AvFILLp(f) = sp - PL_stack_base; \
+ PL_stack_base = AvARRAY(t); \
+ PL_stack_max = PL_stack_base + AvMAX(t); \
+ sp = PL_stack_sp = PL_stack_base + AvFILLp(t); \
+ PL_curstack = t; \
- SSize_t eMiX = PL_tmps_ix + (n); \
- if (UNLIKELY(eMiX >= PL_tmps_max)) \
- (void)Perl_tmps_grow_p(aTHX_ eMiX); \
+ SSize_t eMiX = PL_tmps_ix + (n); \
+ if (UNLIKELY(eMiX >= PL_tmps_max)) \
+ (void)Perl_tmps_grow_p(aTHX_ eMiX); \
/* do SvGETMAGIC on the stack args before checking for overload */
#define tryAMAGICun_MG(method, flags) STMT_START { \
/* do SvGETMAGIC on the stack args before checking for overload */
#define tryAMAGICun_MG(method, flags) STMT_START { \
- if ( UNLIKELY((SvFLAGS(TOPs) & (SVf_ROK|SVs_GMG))) \
- && Perl_try_amagic_un(aTHX_ method, flags)) \
- return NORMAL; \
+ if ( UNLIKELY((SvFLAGS(TOPs) & (SVf_ROK|SVs_GMG))) \
+ && Perl_try_amagic_un(aTHX_ method, flags)) \
+ return NORMAL; \
- if ( UNLIKELY(((SvFLAGS(TOPm1s)|SvFLAGS(TOPs)) & (SVf_ROK|SVs_GMG))) \
- && Perl_try_amagic_bin(aTHX_ method, flags)) \
- return NORMAL; \
+ if ( UNLIKELY(((SvFLAGS(TOPm1s)|SvFLAGS(TOPs)) & (SVf_ROK|SVs_GMG))) \
+ && Perl_try_amagic_bin(aTHX_ method, flags)) \
+ return NORMAL; \
- if (UNLIKELY(SvAMAGIC(arg) && \
- (tmpsv = amagic_call(arg, &PL_sv_undef, meth, \
- AMGf_want_list | AMGf_noright \
- |AMGf_unary)))) \
+ if (UNLIKELY(SvAMAGIC(arg) && \
+ (tmpsv = amagic_call(arg, &PL_sv_undef, meth, \
+ AMGf_want_list | AMGf_noright \
+ |AMGf_unary)))) \
- PUTBACK; \
- if (jump) { \
- OP *jump_o = NORMAL->op_next; \
- while (jump_o->op_type == OP_NULL) \
- jump_o = jump_o->op_next; \
- assert(jump_o->op_type == OP_ENTERSUB); \
- (void)POPMARK; \
- return jump_o->op_next; \
- } \
- return NORMAL; \
- } \
+ PUTBACK; \
+ if (jump) { \
+ OP *jump_o = NORMAL->op_next; \
+ while (jump_o->op_type == OP_NULL) \
+ jump_o = jump_o->op_next; \
+ assert(jump_o->op_type == OP_ENTERSUB); \
+ (void)POPMARK; \
+ return jump_o->op_next; \
+ } \
+ return NORMAL; \
+ } \
} STMT_END
/* This is no longer used anywhere in the core. You might wish to consider
calling amagic_deref_call() directly, as it has a cleaner interface. */
#define tryAMAGICunDEREF(meth) \
STMT_START { \
} STMT_END
/* This is no longer used anywhere in the core. You might wish to consider
calling amagic_deref_call() directly, as it has a cleaner interface. */
#define tryAMAGICunDEREF(meth) \
STMT_START { \
/* Used in various places that need to dereference a glob or globref */
# define MAYBE_DEREF_GV_flags(sv,phlags) \
( \
/* Used in various places that need to dereference a glob or globref */
# define MAYBE_DEREF_GV_flags(sv,phlags) \
( \
- (void)(phlags & SV_GMAGIC && (SvGETMAGIC(sv),0)), \
- isGV_with_GP(sv) \
- ? (GV *)(sv) \
- : SvROK(sv) && SvTYPE(SvRV(sv)) <= SVt_PVLV && \
- (SvGETMAGIC(SvRV(sv)), isGV_with_GP(SvRV(sv))) \
- ? (GV *)SvRV(sv) \
- : NULL \
+ (void)(((phlags) & SV_GMAGIC) && (SvGETMAGIC(sv),0)), \
+ isGV_with_GP(sv) \
+ ? (GV *)(sv) \
+ : SvROK(sv) && SvTYPE(SvRV(sv)) <= SVt_PVLV && \
+ (SvGETMAGIC(SvRV(sv)), isGV_with_GP(SvRV(sv))) \
+ ? (GV *)SvRV(sv) \
+ : NULL \
)
# define MAYBE_DEREF_GV(sv) MAYBE_DEREF_GV_flags(sv,SV_GMAGIC)
# define MAYBE_DEREF_GV_nomg(sv) MAYBE_DEREF_GV_flags(sv,0)
)
# define MAYBE_DEREF_GV(sv) MAYBE_DEREF_GV_flags(sv,SV_GMAGIC)
# define MAYBE_DEREF_GV_nomg(sv) MAYBE_DEREF_GV_flags(sv,0)