This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
op.c: Remove proto storage optimisation for lex subs
authorFather Chrysostomos <sprout@cpan.org>
Mon, 30 Jul 2012 01:47:48 +0000 (18:47 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Sun, 16 Sep 2012 05:45:04 +0000 (22:45 -0700)
It was already #if 0’d out.  This optimisation, copied from package
subs, only makes sense when there is autoloading, which lexical subs
don’t do.  Hence, lexical stubs will be rare indeed, so having an
optimisation for those just creates more nooks to hide bugs.

op.c

diff --git a/op.c b/op.c
index c77b684..36341c2 100644 (file)
--- a/op.c
+++ b/op.c
@@ -6918,24 +6918,6 @@ Perl_newMYSUB(pTHX_ I32 floor, OP *o, OP *proto, OP *attrs, OP *block)
 
     if (SvTYPE(*spot) != SVt_PVCV) {   /* Maybe prototype now, and had at
                                           maximum a prototype before. */
-#if 0
-       if (SvTYPE(*spot) > SVt_NULL) {
-           cv_ckproto_len_flags(*spot, NULL, ps, ps_len, ps_utf8);
-       }
-       if (!block && !attrs && !(CvFLAGS(PL_compcv) & CVf_BUILTIN_ATTRS)
-        && !PL_madskills) {
-         if (ps) {
-           sv_setpvn(*svspot, ps, ps_len);
-            if ( ps_utf8 ) SvUTF8_on(*svspot);
-          }
-         else
-           sv_setiv(*svspot, -1);
-
-         SvREFCNT_dec(compcv);
-         cv = compcv = NULL;
-         goto done;
-       }
-#endif
        SvREFCNT_dec(*spot);
        *spot = NULL;
     }