summaryrefslogtreecommitdiff
path: root/pp_hot.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2006-02-25 00:39:30 +0000
committerNicholas Clark <nick@ccl4.org>2006-02-25 00:39:30 +0000
commitf7877b281b40407827939f44ea94226de573cdbc (patch)
treea9a5cac49427908841ae0bf5a3af524fee855e6a /pp_hot.c
parentfb4fc1faf0cb0e6b2bec4f31ddbca2817f387a6e (diff)
downloadperl-f7877b281b40407827939f44ea94226de573cdbc.tar.gz
Store GvGP in the SV head union. For all the common lookups [eg GvCV()]
this avoids 1 pointer dereference and the associated risk of a CPU cache miss. Although this patch looks deceptively small, I fear its CBV(*) might be rather high. (* Crack By Volume) p4raw-id: //depot/perl@27323
Diffstat (limited to 'pp_hot.c')
-rw-r--r--pp_hot.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/pp_hot.c b/pp_hot.c
index 8d590caa63..d26d8f0c9c 100644
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -1611,6 +1611,9 @@ Perl_do_readline(pTHX)
sv = TARG;
if (SvROK(sv))
sv_unref(sv);
+ else if (isGV_with_GP(sv)) {
+ SvPV_force_nolen(sv);
+ }
SvUPGRADE(sv, SVt_PV);
tmplen = SvLEN(sv); /* remember if already alloced */
if (!tmplen && !SvREADONLY(sv))