This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
pp_entersub(): reduce life of padlist var
authorDavid Mitchell <davem@iabyn.com>
Mon, 13 Jul 2015 15:31:20 +0000 (16:31 +0100)
committerDavid Mitchell <davem@iabyn.com>
Wed, 3 Feb 2016 08:59:37 +0000 (08:59 +0000)
only set it when it's needed

pp_hot.c

index b9562ee..de62d43 100644 (file)
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -3515,7 +3515,7 @@ PP(pp_entersub)
     if (!(CvISXSUB(cv))) {
        /* This path taken at least 75% of the time   */
        dMARK;
-       PADLIST * const padlist = CvPADLIST(cv);
+       PADLIST *padlist;
         I32 depth;
         bool hasargs;
         I32 gimme;
@@ -3544,6 +3544,7 @@ PP(pp_entersub)
        cx->blk_sub.retop = PL_op->op_next;
         cx->blk_sub.old_savestack_ix = old_savestack_ix;
 
+       padlist = CvPADLIST(cv);
        if (UNLIKELY((depth = ++CvDEPTH(cv)) >= 2)) {
            PERL_STACK_OVERFLOW_CHECK();
            pad_push(padlist, depth);