This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Goodbye PERL_XSUB_OLDSTYLE.
authorNicholas Clark <nick@ccl4.org>
Tue, 21 Feb 2006 16:12:37 +0000 (16:12 +0000)
committerNicholas Clark <nick@ccl4.org>
Tue, 21 Feb 2006 16:12:37 +0000 (16:12 +0000)
p4raw-id: //depot/perl@27260

cv.h
ext/B/defsubs_h.PL
ext/B/t/concise-xs.t
ext/Devel/Peek/t/Peek.t
pp_ctl.c
pp_hot.c

diff --git a/cv.h b/cv.h
index 873cecd..dd4e3ec 100644 (file)
--- a/cv.h
+++ b/cv.h
@@ -131,8 +131,7 @@ Returns the stash of the CV.
 #define CVf_NODEBUG    0x0200  /* no DB::sub indirection for this CV
                                   (esp. useful for special XSUBs) */
 #define CVf_CONST      0x0400  /* inlinable sub */
-#define CVf_OLDSTYLE   0x0800
-#define CVf_ISXSUB     0x1000  /* CV is an XSUB, not pure perl.  */
+#define CVf_ISXSUB     0x0800  /* CV is an XSUB, not pure perl.  */
 
 /* This symbol for optimised communication between toke.c and op.c: */
 #define CVf_BUILTIN_ATTRS      (CVf_METHOD|CVf_LOCKED|CVf_LVALUE|CVf_ASSERTION)
@@ -149,12 +148,6 @@ Returns the stash of the CV.
 #define CvANON_on(cv)          (CvFLAGS(cv) |= CVf_ANON)
 #define CvANON_off(cv)         (CvFLAGS(cv) &= ~CVf_ANON)
 
-#ifdef PERL_XSUB_OLDSTYLE
-#define CvOLDSTYLE(cv)         (CvFLAGS(cv) & CVf_OLDSTYLE)
-#define CvOLDSTYLE_on(cv)      (CvFLAGS(cv) |= CVf_OLDSTYLE)
-#define CvOLDSTYLE_off(cv)     (CvFLAGS(cv) &= ~CVf_OLDSTYLE)
-#endif
-
 #define CvUNIQUE(cv)           (CvFLAGS(cv) & CVf_UNIQUE)
 #define CvUNIQUE_on(cv)                (CvFLAGS(cv) |= CVf_UNIQUE)
 #define CvUNIQUE_off(cv)       (CvFLAGS(cv) &= ~CVf_UNIQUE)
index 1127d48..1a87772 100644 (file)
@@ -22,7 +22,6 @@ foreach my $const (qw(
                      CVf_LVALUE
                      CVf_METHOD
                      CVf_NODEBUG
-                     CVf_OLDSTYLE
                      CVf_UNIQUE
                      CVf_WEAKOUTSIDE
                      GVf_IMPORTED_AV
index dcd868f..447c13d 100644 (file)
@@ -117,7 +117,7 @@ use Getopt::Std;
 use Carp;
 use Test::More tests => ( # per-pkg tests (function ct + require_ok)
                          40 + 16       # Data::Dumper, Digest::MD5
-                         + 511 + 234   # B::Deparse, B
+                         + 511 + 233   # B::Deparse, B
                          + 588 + 189   # POSIX, IO::Socket
                          + 3 * ($] > 5.009)
                          + 14 * ($] >= 5.009003)
index 8897329..0f4fbb8 100644 (file)
@@ -509,7 +509,7 @@ do_test(23,
     DEPTH = 0
 (?:    MUTEXP = $ADDR
     OWNER = $ADDR
-)?    FLAGS = 0x1400
+)?    FLAGS = 0xc00
     OUTSIDE_SEQ = 0
     PADLIST = 0x0
     OUTSIDE = 0x0 \\(null\\)');        
index 80113a4..43cf175 100644 (file)
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -2371,29 +2371,13 @@ PP(pp_goto)
            SAVEFREESV(cv); /* later, undo the 'avoid premature free' hack */
            if (CvISXSUB(cv)) {
                OP* retop = cx->blk_sub.retop;
+               SV **newsp;
+               I32 gimme;
                if (reified) {
                    I32 index;
                    for (index=0; index<items; index++)
                        sv_2mortal(SP[-index]);
                }
-#ifdef PERL_XSUB_OLDSTYLE
-               if (CvOLDSTYLE(cv)) {
-                   I32 (*fp3)(int,int,int);
-                   while (SP > mark) {
-                       SP[1] = SP[0];
-                       SP--;
-                   }
-                   fp3 = (I32(*)(int,int,int))CvXSUB(cv);
-                   items = (*fp3)(CvXSUBANY(cv).any_i32,
-                                  mark - PL_stack_base + 1,
-                                  items);
-                   SP = PL_stack_base + items;
-               }
-               else
-#endif /* PERL_XSUB_OLDSTYLE */
-               {
-                   SV **newsp;
-                   I32 gimme;
 
                    /* XS subs don't have a CxSUB, so pop it */
                    POPBLOCK(cx, PL_curpm);
@@ -2404,7 +2388,6 @@ PP(pp_goto)
                    /* Put these at the bottom since the vars are set but not used */
                    PERL_UNUSED_VAR(newsp);
                    PERL_UNUSED_VAR(gimme);
-               }
                LEAVE;
                return retop;
            }
index 242b03c..e352763 100644 (file)
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -2857,26 +2857,6 @@ try_autoload:
        RETURNOP(CvSTART(cv));
     }
     else {
-#ifdef PERL_XSUB_OLDSTYLE
-       if (CvOLDSTYLE(cv)) {
-           I32 (*fp3)(int,int,int);
-           dMARK;
-           register I32 items = SP - MARK;
-                                       /* We dont worry to copy from @_. */
-           while (SP > mark) {
-               SP[1] = SP[0];
-               SP--;
-           }
-           PL_stack_sp = mark + 1;
-           fp3 = (I32(*)(int,int,int))CvXSUB(cv);
-           items = (*fp3)(CvXSUBANY(cv).any_i32,
-                          MARK - PL_stack_base + 1,
-                          items);
-           PL_stack_sp = PL_stack_base + items;
-       }
-       else
-#endif /* PERL_XSUB_OLDSTYLE */
-       {
            I32 markix = TOPMARK;
 
            PUTBACK;
@@ -2913,7 +2893,6 @@ try_autoload:
                    *(PL_stack_base + markix) = *PL_stack_sp;
                PL_stack_sp = PL_stack_base + markix;
            }
-       }
        LEAVE;
        return NORMAL;
     }