diff options
author | Nicholas Clark <nick@ccl4.org> | 2006-02-20 10:40:59 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2006-02-20 10:40:59 +0000 |
commit | aed2304a0354e5cd0ca22ed008e1922f54b0f438 (patch) | |
tree | 1138ff6e0aa651adb9234639339fd66c3cfbf793 | |
parent | 7c60e4340985406f3dd47ad08209883de1b8aa3b (diff) | |
download | perl-aed2304a0354e5cd0ca22ed008e1922f54b0f438.tar.gz |
Add a new CvISXSUB() macro, for abstracting the test as to whether a
PVCV is perl or XS.
p4raw-id: //depot/perl@27241
-rw-r--r-- | cv.h | 2 | ||||
-rw-r--r-- | dump.c | 2 | ||||
-rw-r--r-- | ext/Devel/Peek/Peek.xs | 2 | ||||
-rw-r--r-- | gv.c | 2 | ||||
-rw-r--r-- | op.c | 4 | ||||
-rw-r--r-- | pad.c | 4 | ||||
-rw-r--r-- | pp_ctl.c | 6 | ||||
-rw-r--r-- | pp_hot.c | 4 | ||||
-rw-r--r-- | pp_sort.c | 2 | ||||
-rw-r--r-- | sv.c | 2 |
10 files changed, 15 insertions, 15 deletions
@@ -153,7 +153,7 @@ Returns the stash of the CV. #define CvWEAKOUTSIDE_on(cv) (CvFLAGS(cv) |= CVf_WEAKOUTSIDE) #define CvWEAKOUTSIDE_off(cv) (CvFLAGS(cv) &= ~CVf_WEAKOUTSIDE) - +#define CvISXSUB(cv) (CvXSUB(cv) ? TRUE : FALSE) /* =head1 CV reference counts and CvOUTSIDE @@ -89,7 +89,7 @@ Perl_dump_sub(pTHX_ const GV *gv) gv_fullname3(sv, gv, NULL); Perl_dump_indent(aTHX_ 0, Perl_debug_log, "\nSUB %s = ", SvPVX_const(sv)); - if (CvXSUB(GvCV(gv))) + if (CvISXSUB(GvCV(gv))) Perl_dump_indent(aTHX_ 0, Perl_debug_log, "(xsub 0x%"UVxf" %d)\n", PTR2UV(CvXSUB(GvCV(gv))), (int)CvXSUBANY(GvCV(gv)).any_i32); diff --git a/ext/Devel/Peek/Peek.xs b/ext/Devel/Peek/Peek.xs index 5bec844ccd..a88d23141d 100644 --- a/ext/Devel/Peek/Peek.xs +++ b/ext/Devel/Peek/Peek.xs @@ -39,7 +39,7 @@ DeadCode(pTHX) int levels, tots = 0, levela, tota = 0, levelas, totas = 0; int dumpit = 0; - if (CvXSUB(sv)) { + if (CvISXSUB(sv)) { continue; /* XSUB */ } if (!CvGV(sv)) { @@ -600,7 +600,7 @@ Perl_gv_autoload4(pTHX_ HV *stash, const char *name, STRLEN len, I32 method) "Use of inherited AUTOLOAD for non-method %s::%.*s() is deprecated", packname, (int)len, name); - if (CvXSUB(cv)) { + if (CvISXSUB(cv)) { /* rather than lookup/init $AUTOLOAD here * only to have the XSUB do another lookup for $AUTOLOAD * and split that value on the last '::', @@ -4261,14 +4261,14 @@ Perl_cv_undef(pTHX_ CV *cv) { dVAR; #ifdef USE_ITHREADS - if (CvFILE(cv) && !CvXSUB(cv)) { + if (CvFILE(cv) && !CvISXSUB(cv)) { /* for XSUBs CvFILE point directly to static memory; __FILE__ */ Safefree(CvFILE(cv)); } CvFILE(cv) = 0; #endif - if (!CvXSUB(cv) && CvROOT(cv)) { + if (!CvISXSUB(cv) && CvROOT(cv)) { if (CvDEPTH(cv)) Perl_croak(aTHX_ "Can't undef active subroutine"); ENTER; @@ -1445,8 +1445,8 @@ Perl_cv_clone(pTHX_ CV *proto) CvCLONED_on(cv); #ifdef USE_ITHREADS - CvFILE(cv) = CvXSUB(proto) ? CvFILE(proto) - : savepv(CvFILE(proto)); + CvFILE(cv) = CvISXSUB(proto) ? CvFILE(proto) + : savepv(CvFILE(proto)); #else CvFILE(cv) = CvFILE(proto); #endif @@ -1763,7 +1763,7 @@ PP(pp_dbstate) hasargs = 0; SPAGAIN; - if (CvXSUB(cv)) { + if (CvISXSUB(cv)) { CvDEPTH(cv)++; PUSHMARK(SP); (void)(*CvXSUB(cv))(aTHX_ cv); @@ -2352,7 +2352,7 @@ PP(pp_goto) PAD_SVl(0) = (SV*)(cx->blk_sub.argarray = av); } } - else if (CvXSUB(cv)) { /* put GvAV(defgv) back onto stack */ + else if (CvISXSUB(cv)) { /* put GvAV(defgv) back onto stack */ AV* const av = GvAV(PL_defgv); items = AvFILLp(av) + 1; EXTEND(SP, items+1); /* @_ could have been extended. */ @@ -2369,7 +2369,7 @@ PP(pp_goto) /* Now do some callish stuff. */ SAVETMPS; SAVEFREESV(cv); /* later, undo the 'avoid premature free' hack */ - if (CvXSUB(cv)) { + if (CvISXSUB(cv)) { OP* retop = cx->blk_sub.retop; if (reified) { I32 index; @@ -2667,7 +2667,7 @@ S_get_db_sub(pTHX_ SV **svp, CV *cv) SvIV_set(dbsv, PTR2IV(cv)); /* Do it the quickest way */ } - if (CvXSUB(cv)) + if (CvISXSUB(cv)) PL_curcopdb = PL_curcop; cv = GvCV(PL_DBsub); return cv; @@ -2785,7 +2785,7 @@ try_autoload: DIE(aTHX_ "No DB::sub routine defined"); } - if (!(CvXSUB(cv))) { + if (!(CvISXSUB(cv))) { /* This path taken at least 75% of the time */ dMARK; register I32 items = SP - MARK; @@ -1515,7 +1515,7 @@ PP(pp_sort) } } if (!(cv && CvROOT(cv))) { - if (cv && CvXSUB(cv)) { + if (cv && CvISXSUB(cv)) { is_xsub = 1; } else if (gv) { @@ -9843,7 +9843,7 @@ Perl_sv_dup(pTHX_ const SV *sstr, CLONE_PARAMS* param) CvWEAKOUTSIDE(sstr) ? cv_dup( CvOUTSIDE(dstr), param) : cv_dup_inc(CvOUTSIDE(dstr), param); - if (!CvXSUB(dstr)) + if (!CvISXSUB(dstr)) CvFILE(dstr) = SAVEPV(CvFILE(dstr)); break; } |