summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2006-02-20 10:40:59 +0000
committerNicholas Clark <nick@ccl4.org>2006-02-20 10:40:59 +0000
commitaed2304a0354e5cd0ca22ed008e1922f54b0f438 (patch)
tree1138ff6e0aa651adb9234639339fd66c3cfbf793
parent7c60e4340985406f3dd47ad08209883de1b8aa3b (diff)
downloadperl-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.h2
-rw-r--r--dump.c2
-rw-r--r--ext/Devel/Peek/Peek.xs2
-rw-r--r--gv.c2
-rw-r--r--op.c4
-rw-r--r--pad.c4
-rw-r--r--pp_ctl.c6
-rw-r--r--pp_hot.c4
-rw-r--r--pp_sort.c2
-rw-r--r--sv.c2
10 files changed, 15 insertions, 15 deletions
diff --git a/cv.h b/cv.h
index 9f2594a19f..7e60be7e1a 100644
--- a/cv.h
+++ b/cv.h
@@ -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
diff --git a/dump.c b/dump.c
index 6799c47541..02b1c22a2e 100644
--- a/dump.c
+++ b/dump.c
@@ -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)) {
diff --git a/gv.c b/gv.c
index 555260f40b..d866b6636e 100644
--- a/gv.c
+++ b/gv.c
@@ -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 '::',
diff --git a/op.c b/op.c
index 2830834ae1..cb507bac77 100644
--- a/op.c
+++ b/op.c
@@ -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;
diff --git a/pad.c b/pad.c
index aa806ea95a..75f08389d0 100644
--- a/pad.c
+++ b/pad.c
@@ -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
diff --git a/pp_ctl.c b/pp_ctl.c
index 725920f296..80113a49a8 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -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;
diff --git a/pp_hot.c b/pp_hot.c
index 677808f3f9..242b03c11c 100644
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -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;
diff --git a/pp_sort.c b/pp_sort.c
index 48595886cb..104e8ed90d 100644
--- a/pp_sort.c
+++ b/pp_sort.c
@@ -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) {
diff --git a/sv.c b/sv.c
index 30b84f088d..75ba895836 100644
--- a/sv.c
+++ b/sv.c
@@ -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;
}