diff options
author | Nicholas Clark <nick@ccl4.org> | 2005-12-22 11:23:34 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2005-12-22 11:23:34 +0000 |
commit | e26df76ac13ccf3f750bea05eac65b7ffffc7826 (patch) | |
tree | d11edf27d8ba34c895c8936275642e04a8ccebb9 /gv.c | |
parent | 08247bd41cc7b76a946c65fcbf364608f5bde98d (diff) | |
download | perl-e26df76ac13ccf3f750bea05eac65b7ffffc7826.tar.gz |
Add an optimisation to allow proxy constant subroutines to be copied
as proxy constant subroutines in a new symbol table where possible.
(Rather than converting them to full blown constant subroutines and
instantiating 2 typeglobs)
p4raw-id: //depot/perl@26446
Diffstat (limited to 'gv.c')
-rw-r--r-- | gv.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -742,7 +742,8 @@ Perl_gv_fetchpvn_flags(pTHX_ const char *nambeg, STRLEN full_len, I32 flags, register const char *namend; HV *stash = 0; const I32 no_init = flags & (GV_NOADD_NOINIT | GV_NOINIT); - const I32 add = flags & ~SVf_UTF8 & ~ GV_NOADD_NOINIT; + const I32 no_expand = flags & GV_NOEXPAND; + const I32 add = flags & ~SVf_UTF8 & ~GV_NOADD_NOINIT & ~GV_NOEXPAND; PERL_UNUSED_ARG(full_len); @@ -909,6 +910,8 @@ Perl_gv_fetchpvn_flags(pTHX_ const char *nambeg, STRLEN full_len, I32 flags, return gv; } else if (no_init) { return gv; + } else if (no_expand && SvROK(gv)) { + return gv; } /* Adding a new symbol */ |