In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/4bff32c56f5c1d1515069d4ce0d05531758f6561?hp=a7b227680272751bf7f4d4e9cc85ead19aa13ffa>
- Log ----------------------------------------------------------------- commit 4bff32c56f5c1d1515069d4ce0d05531758f6561 Author: Father Chrysostomos <[email protected]> Date: Sat Sep 6 22:42:19 2014 -0700 Remove GV_ADDINEVAL This flag does absolutely nothing. The use of 8 as a flag to pass to gv_fetchpv was added in this commit: commit 93233ece75d8fe98a77377e72c4d6004c5ea8691 Author: Chip Salzenberg <[email protected]> Date: Tue Mar 3 04:39:49 1998 +0000 [win32] merge problematic maintpatch to op.c #77: "Eliminate double warnings under C<package;>" Files: gv.c op.c toke.c But nothing in gv.c made use of it at the time. Later it was changed into a #define in commit 0f303493c6. Subse- quently more uses were added in 77ca0c92 and f558d5af04. It still does nothing. Nothing outside the perl core references it. M gv.h M toke.c commit b69f5762a54ed8985a9b50b54cbf5912ffda3ea4 Author: Father Chrysostomos <[email protected]> Date: Sat Sep 6 17:38:29 2014 -0700 mro.c: Donât inline sv_sethek This code actually long predates sv_sethek. But now that we have it, we can call it, reducing the size of mro.o. M mro.c ----------------------------------------------------------------------- Summary of changes: gv.h | 2 +- mro.c | 14 +------------- toke.c | 13 ++++--------- 3 files changed, 6 insertions(+), 23 deletions(-) diff --git a/gv.h b/gv.h index 5071591..6e3295c 100644 --- a/gv.h +++ b/gv.h @@ -221,7 +221,7 @@ Return the CV from the GV. #define GV_ADDMULTI 0x02 /* add, pretending it has been added already; used also by gv_init_* */ #define GV_ADDWARN 0x04 /* add, but warn if symbol wasn't already there */ -#define GV_ADDINEVAL 0x08 /* add, as though we're doing so within an eval */ + /* 0x08 UNUSED */ #define GV_NOINIT 0x10 /* add, but don't init symbol, if type != PVGV */ /* This is used by toke.c to avoid turing placeholder constants in the symbol table into full PVGVs with attached constant subroutines. */ diff --git a/mro.c b/mro.c index c9b40e5..5f7b939 100644 --- a/mro.c +++ b/mro.c @@ -307,19 +307,7 @@ S_mro_get_linear_isa_dfs(pTHX_ HV *stash, U32 level) HEK *const key = HeKEY_hek(he); HeVAL(he) = &PL_sv_undef; - /* Save copying by making a shared hash key scalar. We - inline this here rather than calling - Perl_newSVpvn_share because we already have the - scalar, and we already have the hash key. */ - assert(SvTYPE(val) == SVt_NULL); - sv_upgrade(val, SVt_PV); - SvPV_set(val, HEK_KEY(share_hek_hek(key))); - SvCUR_set(val, HEK_LEN(key)); - SvIsCOW_on(val); - SvPOK_on(val); - if (HEK_UTF8(key)) - SvUTF8_on(val); - + sv_sethek(val, key); av_push(retval, val); } } diff --git a/toke.c b/toke.c index b98fe6f..028c685 100644 --- a/toke.c +++ b/toke.c @@ -2054,7 +2054,7 @@ S_force_ident(pTHX_ const char *s, int kind) warnings if the symbol must be introduced in an eval. GSAR 96-10-12 */ gv_fetchpvn_flags(s, len, - (PL_in_eval ? (GV_ADDMULTI | GV_ADDINEVAL) + (PL_in_eval ? GV_ADDMULTI : GV_ADD) | ( UTF ? SVf_UTF8 : 0 ), kind == '$' ? SVt_PV : kind == '@' ? SVt_PVAV : @@ -8162,10 +8162,7 @@ S_pending_ident(pTHX) pl_yylval.opval->op_private = OPpCONST_ENTERED; if (pit != '&') gv_fetchsv(sym, - (PL_in_eval - ? (GV_ADDMULTI | GV_ADDINEVAL) - : GV_ADDMULTI - ), + GV_ADDMULTI, ((PL_tokenbuf[0] == '$') ? SVt_PV : (PL_tokenbuf[0] == '@') ? SVt_PVAV : SVt_PVHV)); @@ -8209,7 +8206,7 @@ S_pending_ident(pTHX) pl_yylval.opval->op_private = OPpCONST_ENTERED; if (pit != '&') gv_fetchpvn_flags(PL_tokenbuf+1, tokenbuf_len - 1, - (PL_in_eval ? (GV_ADDMULTI | GV_ADDINEVAL) : GV_ADD) + (PL_in_eval ? GV_ADDMULTI : GV_ADD) | ( UTF ? SVf_UTF8 : 0 ), ((PL_tokenbuf[0] == '$') ? SVt_PV : (PL_tokenbuf[0] == '@') ? SVt_PVAV @@ -9384,9 +9381,7 @@ S_scan_inputsymbol(pTHX_ char *start) ++d; intro_sym: gv = gv_fetchpv(d, - (PL_in_eval - ? (GV_ADDMULTI | GV_ADDINEVAL) - : GV_ADDMULTI) | ( UTF ? SVf_UTF8 : 0 ), + GV_ADDMULTI | ( UTF ? SVf_UTF8 : 0 ), SVt_PV); PL_lex_op = readline_overriden ? (OP*)newUNOP(OP_ENTERSUB, OPf_STACKED, -- Perl5 Master Repository
