summaryrefslogtreecommitdiff
path: root/gv.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2005-12-22 11:23:34 +0000
committerNicholas Clark <nick@ccl4.org>2005-12-22 11:23:34 +0000
commite26df76ac13ccf3f750bea05eac65b7ffffc7826 (patch)
treed11edf27d8ba34c895c8936275642e04a8ccebb9 /gv.c
parent08247bd41cc7b76a946c65fcbf364608f5bde98d (diff)
downloadperl-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.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gv.c b/gv.c
index 418e08c7d2..4763cd8e26 100644
--- a/gv.c
+++ b/gv.c
@@ -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 */