diff options
author | Karl Williamson <khw@cpan.org> | 2019-09-11 17:24:38 -0600 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2019-09-15 10:39:56 -0600 |
commit | 74804ad189340f2812955e3c4308a6a82c0cc0eb (patch) | |
tree | 01891d566d72b257679694fe7e8fce804bf08445 | |
parent | 94b0cb42d04bb202dba31ef85db6c93b0c93ae6d (diff) | |
download | perl-74804ad189340f2812955e3c4308a6a82c0cc0eb.tar.gz |
Add embed.fnc entries for Cv inline fcns
and change the name of one. CvDEPTH shouldn't have a trailing 'p' to
indicate private memeber access. It may do so internally, but the name
shouldn't indicate that.
-rw-r--r-- | cv.h | 4 | ||||
-rw-r--r-- | embed.fnc | 2 | ||||
-rw-r--r-- | inline.h | 6 | ||||
-rw-r--r-- | proto.h | 10 |
4 files changed, 19 insertions, 3 deletions
@@ -61,9 +61,9 @@ See L<perlguts/Autoloading with XSUBs>. (CvFILE(sv) = CopFILE(cop), CvDYNFILE_off(sv)) #endif #define CvFILEGV(sv) (gv_fetchfile(CvFILE(sv))) -#define CvDEPTH(sv) (*Perl_CvDEPTHp((const CV *)sv)) +#define CvDEPTH(sv) (*Perl_CvDEPTH((const CV *)sv)) /* For use when you only have a XPVCV*, not a real CV*. - Must be assert protected as in S_CvDEPTHp before use. */ + Must be assert protected as in Perl_CvDEPTH before use. */ #define CvDEPTHunsafe(sv) ((XPVCV*)MUTABLE_PTR(SvANY(sv)))->xcv_depth /* these CvPADLIST/CvRESERVED asserts can be reverted one day, once stabilized */ @@ -572,6 +572,8 @@ Apd |void |cv_undef |NN CV* cv p |void |cv_undef_flags |NN CV* cv|U32 flags pd |void |cv_forget_slab |NULLOK CV *cv Ap |void |cx_dump |NN PERL_CONTEXT* cx +AiMp |GV * |CvGV |NN CV *sv +AiMTp |I32 * |CvDEPTH |NN const CV * const sv Aphd |SV* |filter_add |NULLOK filter_t funcp|NULLOK SV* datasv Ap |void |filter_del |NN filter_t funcp ApRhd |I32 |filter_read |int idx|NN SV *buf_sv|int maxlen @@ -53,15 +53,19 @@ Perl_av_top_index(pTHX_ AV *av) PERL_STATIC_INLINE GV * Perl_CvGV(pTHX_ CV *sv) { + PERL_ARGS_ASSERT_CVGV; + return CvNAMED(sv) ? Perl_cvgv_from_hek(aTHX_ sv) : ((XPVCV*)MUTABLE_PTR(SvANY(sv)))->xcv_gv_u.xcv_gv; } PERL_STATIC_INLINE I32 * -Perl_CvDEPTHp(const CV * const sv) +Perl_CvDEPTH(const CV * const sv) { + PERL_ARGS_ASSERT_CVDEPTH; assert(SvTYPE(sv) == SVt_PVCV || SvTYPE(sv) == SVt_PVFM); + return &((XPVCV*)SvANY(sv))->xcv_depth; } @@ -25,6 +25,16 @@ PERL_CALLCONV UV ASCII_TO_NEED(const UV enc, const UV ch) #define PERL_ARGS_ASSERT_ASCII_TO_NEED #endif +#ifndef PERL_NO_INLINE_FUNCTIONS +PERL_STATIC_INLINE I32 * Perl_CvDEPTH(const CV * const sv); +#define PERL_ARGS_ASSERT_CVDEPTH \ + assert(sv) +#endif +#ifndef PERL_NO_INLINE_FUNCTIONS +PERL_STATIC_INLINE GV * Perl_CvGV(pTHX_ CV *sv); +#define PERL_ARGS_ASSERT_CVGV \ + assert(sv) +#endif PERL_CALLCONV int Perl_Gv_AMupdate(pTHX_ HV* stash, bool destructing); #define PERL_ARGS_ASSERT_GV_AMUPDATE \ assert(stash) |