diff options
author | David Mitchell <davem@iabyn.com> | 2016-01-04 09:16:52 +0000 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2016-02-03 09:19:21 +0000 |
commit | 1c23e2bdad29ff1daf6392412fffae9341795834 (patch) | |
tree | 2870d0000ec000d13e363c8a74ed81f224e261fa /pp_hot.c | |
parent | 263e0548e81a5558c883eb43d9a72c5f20f67741 (diff) | |
download | perl-1c23e2bdad29ff1daf6392412fffae9341795834.tar.gz |
make gimme consistently U8
The value of gimme stored in the context stack is U8.
Make all other uses in the main core consistent with this.
My primary motivation on this was that the new function cx_pushblock(),
which I gave a 'U8 gimme' parameter, was generating warnings where callers
were passing I32 gimme vars to it. Rather than play whack-a-mole, it
seemed simpler to just uniformly use U8 everywhere.
Porting/bench.pl shows a consistent reduction of about 2 instructions on
the loop and sub benchmarks, so this change isn't harming performance.
Diffstat (limited to 'pp_hot.c')
-rw-r--r-- | pp_hot.c | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -963,7 +963,7 @@ PP(pp_print) PP(pp_rv2av) { dSP; dTOPss; - const I32 gimme = GIMME_V; + const U8 gimme = GIMME_V; static const char an_array[] = "an ARRAY"; static const char a_hash[] = "a HASH"; const bool is_pp_rv2av = PL_op->op_type == OP_RV2AV @@ -1251,7 +1251,7 @@ PP(pp_aassign) SV *sv; AV *ary; - I32 gimme; + U8 gimme; HV *hash; SSize_t i; int magic; @@ -1716,7 +1716,7 @@ PP(pp_match) const char *truebase; /* Start of string */ REGEXP *rx = PM_GETRE(pm); bool rxtainted; - const I32 gimme = GIMME_V; + const U8 gimme = GIMME_V; STRLEN len; const I32 oldsave = PL_savestack_ix; I32 had_zerolen = 0; @@ -1908,7 +1908,7 @@ Perl_do_readline(pTHX) PerlIO *fp; IO * const io = GvIO(PL_last_in_gv); const I32 type = PL_op->op_type; - const I32 gimme = GIMME_V; + const U8 gimme = GIMME_V; if (io) { const MAGIC *const mg = SvTIED_mg((const SV *)io, PERL_MAGIC_tiedscalar); @@ -3268,7 +3268,7 @@ PP(pp_grepwhile) /* All done yet? */ if (UNLIKELY(PL_stack_base + *PL_markstack_ptr > SP)) { I32 items; - const I32 gimme = GIMME_V; + const U8 gimme = GIMME_V; LEAVE_with_name("grep"); /* exit outer scope */ (void)POPMARK; /* pop src */ @@ -3362,7 +3362,7 @@ PP(pp_grepwhile) */ void -Perl_leave_adjust_stacks(pTHX_ SV **from_sp, SV **to_sp, I32 gimme, int pass) +Perl_leave_adjust_stacks(pTHX_ SV **from_sp, SV **to_sp, U8 gimme, int pass) { dVAR; dSP; @@ -3616,7 +3616,7 @@ Perl_leave_adjust_stacks(pTHX_ SV **from_sp, SV **to_sp, I32 gimme, int pass) PP(pp_leavesub) { - I32 gimme; + U8 gimme; PERL_CONTEXT *cx; SV **oldsp; OP *retop; @@ -3833,7 +3833,7 @@ PP(pp_entersub) PADLIST *padlist; I32 depth; bool hasargs; - I32 gimme; + U8 gimme; /* keep PADTMP args alive throughout the call (we need to do this * because @_ isn't refcounted). Note that we create the mortals |