#define PP(s) OP * Perl_##s(pTHX)
/*
-=head1 Stack Manipulation Macros
+=for apidoc_section $stack
-=for apidoc AmU||SP
+=for apidoc AmnU||SP
Stack pointer. This is usually handled by C<xsubpp>. See C<L</dSP>> and
C<SPAGAIN>.
-=for apidoc AmU||MARK
+=for apidoc AmnU||MARK
Stack marker variable for the XSUB. See C<L</dMARK>>.
=for apidoc Am|void|PUSHMARK|SP
=for apidoc Amns||dORIGMARK
Saves the original stack mark for the XSUB. See C<L</ORIGMARK>>.
-=for apidoc AmU||ORIGMARK
+=for apidoc AmnU||ORIGMARK
The original stack mark for the XSUB. See C<L</dORIGMARK>>.
=for apidoc Amns||SPAGAIN
#undef SP /* Solaris 2.7 i386 has this in /usr/include/sys/reg.h */
#define SP sp
#define MARK mark
+
+/*
+=for apidoc Amns||TARG
+
+C<TARG> is short for "target". It is an entry in the pad that an OPs
+C<op_targ> refers to. It is scratchpad space, often used as a return
+value for the OP, but some use it for other purposes.
+
+=cut
+*/
#define TARG targ
#define PUSHMARK(p) \
PL_markstack_ptr, (IV)*mark_stack_entry))); \
} STMT_END
-#define TOPMARK S_TOPMARK(aTHX)
-#define POPMARK S_POPMARK(aTHX)
+#define TOPMARK Perl_TOPMARK(aTHX)
+#define POPMARK Perl_POPMARK(aTHX)
#define INCMARK \
STMT_START { \
#define dTARGETSTACKED SV * GETTARGETSTACKED
#define GETTARGET targ = PAD_SV(PL_op->op_targ)
+
+/*
+=for apidoc Amns||dTARGET
+Declare that this function uses C<TARG>
+
+=cut
+*/
#define dTARGET SV * GETTARGET
#define GETATARGET targ = (PL_op->op_flags & OPf_STACKED ? sp[-1] : PAD_SV(PL_op->op_targ))
for this element. Does not use C<TARG>. See also C<L</PUSHs>> and
C<L</mXPUSHs>>.
-=for apidoc Am|void|PUSHmortal
+=for apidoc Amn|void|PUSHmortal
Push a new mortal SV onto the stack. The stack must have room for this
element. Does not use C<TARG>. See also C<L</PUSHs>>, C<L</XPUSHmortal>> and
C<L</XPUSHs>>.
Push an SV onto the stack, extending the stack if necessary and mortalizes
the SV. Does not use C<TARG>. See also C<L</XPUSHs>> and C<L</mPUSHs>>.
-=for apidoc Am|void|XPUSHmortal
+=for apidoc Amn|void|XPUSHmortal
Push a new mortal SV onto the stack, extending the stack if necessary.
Does not use C<TARG>. See also C<L</XPUSHs>>, C<L</PUSHmortal>> and
C<L</PUSHs>>.
/* EXTEND_SKIP(): used for where you would normally call EXTEND(), but
* you know for sure that a previous op will have already extended the
- * stack sufficiently. For example pp_enteriter ensures that that there
+ * stack sufficiently. For example pp_enteriter ensures that there
* is always at least 1 free slot, so pp_iter can return &PL_sv_yes/no
* without checking each time. Calling EXTEND_SKIP() defeats the HWM
* debugging mechanism which would otherwise whine
SSize_t i; \
SSize_t len; \
assert(SvTYPE(tmpsv) == SVt_PVAV); \
- len = av_tindex((AV *)tmpsv) + 1; \
+ len = av_count((AV *)tmpsv); \
(void)POPs; /* get rid of the arg */ \
EXTEND(sp, len); \
for (i = 0; i < len; ++i) \
#define opASSIGN (PL_op->op_flags & OPf_STACKED)
/*
-=for apidoc mU||LVRET
+=for apidoc mnU||LVRET
True if this op will be the return value of an lvalue subroutine
=cut */