From 99e4f4b1c4bc11fc21660d3dcd3c6eb584361c54 Mon Sep 17 00:00:00 2001 From: David Mitchell Date: Tue, 5 Dec 2023 12:13:21 +0000 Subject: [PATCH] remove unused tryAMAGICunTARGETlist macro This macro was originally only used in two places in core (pp_readline and pp_glob), and nowhere on CPAN. The last few commits inlined those only two usages, then modified the functions using that code to be PERL_RC_STACK-aware. Since the macro is now unused, and is the old obsolete non-PERL_RC_STACK code, this commit just deletes it. --- pp.h | 47 ----------------------------------------------- 1 file changed, 47 deletions(-) diff --git a/pp.h b/pp.h index cb84fc6d0e..866c01e1e3 100644 --- a/pp.h +++ b/pp.h @@ -681,53 +681,6 @@ Does not use C. See also C>, C> and C>. /* No longer used in core. Use AMG_CALLunary instead */ #define AMG_CALLun(sv,meth) AMG_CALLunary(sv, CAT2(meth,_amg)) -/* No longer used in core. Was expanded directly into its only two users, - * pp_readline and pp_glob */ -#define tryAMAGICunTARGETlist(meth, jump) \ - STMT_START { \ - dSP; \ - SV *tmpsv; \ - SV *arg= *sp; \ - U8 gimme = GIMME_V; \ - if (UNLIKELY(SvAMAGIC(arg) && \ - (tmpsv = amagic_call(arg, &PL_sv_undef, meth, \ - AMGf_want_list | AMGf_noright \ - |AMGf_unary)))) \ - { \ - SPAGAIN; \ - if (gimme == G_VOID) { \ - NOOP; \ - } \ - else if (gimme == G_LIST) { \ - SSize_t i; \ - SSize_t len; \ - assert(SvTYPE(tmpsv) == SVt_PVAV); \ - len = av_count((AV *)tmpsv); \ - (void)POPs; /* get rid of the arg */ \ - EXTEND(sp, len); \ - for (i = 0; i < len; ++i) \ - PUSHs(av_shift((AV *)tmpsv)); \ - } \ - else { /* AMGf_want_scalar */ \ - dATARGET; /* just use the arg's location */ \ - sv_setsv(TARG, tmpsv); \ - if (PL_op->op_flags & OPf_STACKED) \ - sp--; \ - SETTARG; \ - } \ - 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) \