Skip to content

Commit

Permalink
Merge 51c25d3 into 18e5156
Browse files Browse the repository at this point in the history
  • Loading branch information
schwern committed May 24, 2021
2 parents 18e5156 + 51c25d3 commit b6f756b
Show file tree
Hide file tree
Showing 17 changed files with 24,016 additions and 24,016 deletions.
98 changes: 49 additions & 49 deletions XSUB.h
Expand Up @@ -160,34 +160,34 @@ is a lexical C<$_> in scope.
#define dAX const I32 ax = (I32)(MARK - PL_stack_base + 1)

#define dAXMARK \
I32 ax = POPMARK; \
SV **mark = PL_stack_base + ax++
I32 ax = POPMARK; \
SV **mark = PL_stack_base + ax++

#define dITEMS I32 items = (I32)(SP - MARK)

#define dXSARGS \
dSP; dAXMARK; dITEMS
dSP; dAXMARK; dITEMS
/* These 3 macros are replacements for dXSARGS macro only in bootstrap.
They factor out common code in every BOOT XSUB. Computation of vars mark
and items will optimize away in most BOOT functions. Var ax can never be
optimized away since BOOT must return &PL_sv_yes by default from xsubpp.
Note these macros are not drop in replacements for dXSARGS since they set
PL_xsubfilename. */
#define dXSBOOTARGSXSAPIVERCHK \
I32 ax = XS_BOTHVERSION_SETXSUBFN_POPMARK_BOOTCHECK; \
SV **mark = PL_stack_base + ax - 1; dSP; dITEMS
I32 ax = XS_BOTHVERSION_SETXSUBFN_POPMARK_BOOTCHECK; \
SV **mark = PL_stack_base + ax - 1; dSP; dITEMS
#define dXSBOOTARGSAPIVERCHK \
I32 ax = XS_APIVERSION_SETXSUBFN_POPMARK_BOOTCHECK; \
SV **mark = PL_stack_base + ax - 1; dSP; dITEMS
I32 ax = XS_APIVERSION_SETXSUBFN_POPMARK_BOOTCHECK; \
SV **mark = PL_stack_base + ax - 1; dSP; dITEMS
/* dXSBOOTARGSNOVERCHK has no API in xsubpp to choose it so do
#undef dXSBOOTARGSXSAPIVERCHK
#define dXSBOOTARGSXSAPIVERCHK dXSBOOTARGSNOVERCHK */
#define dXSBOOTARGSNOVERCHK \
I32 ax = XS_SETXSUBFN_POPMARK; \
SV **mark = PL_stack_base + ax - 1; dSP; dITEMS
I32 ax = XS_SETXSUBFN_POPMARK; \
SV **mark = PL_stack_base + ax - 1; dSP; dITEMS

#define dXSTARG SV * const targ = ((PL_op->op_private & OPpENTERSUB_HASTARG) \
? PAD_SV(PL_op->op_targ) : sv_newmortal())
? PAD_SV(PL_op->op_targ) : sv_newmortal())

/* Should be used before final PUSHi etc. if not in PPCODE section. */
#define XSprePUSH (sp = PL_stack_base + ax - 1)
Expand All @@ -206,7 +206,7 @@ is a lexical C<$_> in scope.
#define dXSFUNCTION(ret) XSINTERFACE_CVT(ret,XSFUNCTION)
#define XSINTERFACE_FUNC(ret,cv,f) ((XSINTERFACE_CVT_ANON(ret))(f))
#define XSINTERFACE_FUNC_SET(cv,f) \
CvXSUBANY(cv).any_dxptr = (void (*) (pTHX_ void*))(f)
CvXSUBANY(cv).any_dxptr = (void (*) (pTHX_ void*))(f)

#define dUNDERBAR dNOOP
#define UNDERBAR find_rundefsv()
Expand Down Expand Up @@ -323,10 +323,10 @@ Rethrows a previously caught exception. See L<perlguts/"Exception Handling">.

#define XSRETURN(off) \
STMT_START { \
const IV tmpXSoff = (off); \
assert(tmpXSoff >= 0);\
PL_stack_sp = PL_stack_base + ax + (tmpXSoff - 1); \
return; \
const IV tmpXSoff = (off); \
assert(tmpXSoff >= 0);\
PL_stack_sp = PL_stack_base + ax + (tmpXSoff - 1); \
return; \
} STMT_END

#define XSRETURN_IV(v) STMT_START { XST_mIV(0,v); XSRETURN(1); } STMT_END
Expand Down Expand Up @@ -409,48 +409,48 @@ Rethrows a previously caught exception. See L<perlguts/"Exception Handling">.
*/

#define DBM_setFilter(db_type,code) \
STMT_START { \
if (db_type) \
RETVAL = sv_mortalcopy(db_type) ; \
ST(0) = RETVAL ; \
if (db_type && (code == &PL_sv_undef)) { \
SvREFCNT_dec_NN(db_type) ; \
db_type = NULL ; \
} \
else if (code) { \
if (db_type) \
sv_setsv(db_type, code) ; \
else \
db_type = newSVsv(code) ; \
} \
} STMT_END
STMT_START { \
if (db_type) \
RETVAL = sv_mortalcopy(db_type) ; \
ST(0) = RETVAL ; \
if (db_type && (code == &PL_sv_undef)) { \
SvREFCNT_dec_NN(db_type) ; \
db_type = NULL ; \
} \
else if (code) { \
if (db_type) \
sv_setsv(db_type, code) ; \
else \
db_type = newSVsv(code) ; \
} \
} STMT_END

#define DBM_ckFilter(arg,type,name) \
STMT_START { \
if (db->type) { \
if (db->filtering) { \
croak("recursion detected in %s", name) ; \
} \
ENTER ; \
SAVETMPS ; \
SAVEINT(db->filtering) ; \
db->filtering = TRUE ; \
SAVE_DEFSV ; \
if (db->type) { \
if (db->filtering) { \
croak("recursion detected in %s", name) ; \
} \
ENTER ; \
SAVETMPS ; \
SAVEINT(db->filtering) ; \
db->filtering = TRUE ; \
SAVE_DEFSV ; \
if (name[7] == 's') \
arg = newSVsv(arg); \
DEFSV_set(arg) ; \
SvTEMP_off(arg) ; \
PUSHMARK(SP) ; \
PUTBACK ; \
(void) perl_call_sv(db->type, G_DISCARD); \
SPAGAIN ; \
PUTBACK ; \
FREETMPS ; \
LEAVE ; \
DEFSV_set(arg) ; \
SvTEMP_off(arg) ; \
PUSHMARK(SP) ; \
PUTBACK ; \
(void) perl_call_sv(db->type, G_DISCARD); \
SPAGAIN ; \
PUTBACK ; \
FREETMPS ; \
LEAVE ; \
if (name[7] == 's'){ \
arg = sv_2mortal(arg); \
} \
} } STMT_END
} } STMT_END

#if 1 /* for compatibility */
# define VTBL_sv &PL_vtbl_sv
Expand Down

0 comments on commit b6f756b

Please sign in to comment.