# define SvREFCNT_inc_simple_void(sv) ((void) SvREFCNT_inc(sv))
#endif
+#ifndef mPUSHi
+# define mPUSHi(I) PUSHs(sv_2mortal(newSViv(I)))
+#endif
+
#ifndef GvCV_set
# define GvCV_set(G, C) (GvCV(G) = (C))
#endif
#endif /* SU_THREADSAFE */
-SV *
+void
HERE()
PROTOTYPE:
PREINIT:
I32 cxix = cxstack_ix;
-CODE:
+PPCODE:
if (PL_DBsub)
SU_SKIP_DB(cxix);
- RETVAL = newSViv(cxix);
-OUTPUT:
- RETVAL
+ EXTEND(SP, 1);
+ mPUSHi(cxix);
+ XSRETURN(1);
-SV *
+void
UP(...)
PROTOTYPE: ;$
PREINIT:
I32 cxix;
-CODE:
+PPCODE:
SU_GET_CONTEXT(0, 0);
if (--cxix < 0)
cxix = 0;
if (PL_DBsub)
SU_SKIP_DB(cxix);
- RETVAL = newSViv(cxix);
-OUTPUT:
- RETVAL
+ EXTEND(SP, 1);
+ mPUSHi(cxix);
+ XSRETURN(1);
void
SUB(...)
I32 cxix;
PPCODE:
SU_GET_CONTEXT(0, 0);
+ EXTEND(SP, 1);
for (; cxix >= 0; --cxix) {
PERL_CONTEXT *cx = cxstack + cxix;
switch (CxTYPE(cx)) {
case CXt_SUB:
if (PL_DBsub && cx->blk_sub.cv == GvCV(PL_DBsub))
continue;
- ST(0) = sv_2mortal(newSViv(cxix));
+ mPUSHi(cxix);
XSRETURN(1);
}
}
I32 cxix;
PPCODE:
SU_GET_CONTEXT(0, 0);
+ EXTEND(SP, 1);
for (; cxix >= 0; --cxix) {
PERL_CONTEXT *cx = cxstack + cxix;
switch (CxTYPE(cx)) {
default:
continue;
case CXt_EVAL:
- ST(0) = sv_2mortal(newSViv(cxix));
+ mPUSHi(cxix);
XSRETURN(1);
}
}
if (cxix < 0)
cxix = 0;
}
- ST(0) = sv_2mortal(newSViv(cxix));
+ EXTEND(SP, 1);
+ mPUSHi(cxix);
XSRETURN(1);
void
}
}
done:
- ST(0) = sv_2mortal(newSViv(cxix));
+ EXTEND(SP, 1);
+ mPUSHi(cxix);
XSRETURN(1);
void
I32 cxix;
PPCODE:
SU_GET_CONTEXT(0, 0);
+ EXTEND(SP, 1);
while (cxix > 0) {
PERL_CONTEXT *cx = cxstack + cxix--;
switch (CxTYPE(cx)) {
PL_stack_sp--;
args = items - 2;
}
+ /* su_uplevel() takes care of extending the stack if needed. */
ret = su_uplevel((CV *) code, cxix, args);
XSRETURN(ret);
default: