summaryrefslogtreecommitdiff
path: root/regexec.c
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2014-02-27 15:30:26 +0000
committerDavid Mitchell <davem@iabyn.com>2014-02-27 16:16:18 +0000
commit60779a30f61297ad86e175f686b7bc697c7b8e51 (patch)
treee1e560a9e7820e720fd99ef8f3d3c8ba46880dc6 /regexec.c
parent89a18b40609cfdfc4af7414a628064c743b836bd (diff)
downloadperl-60779a30f61297ad86e175f686b7bc697c7b8e51.tar.gz
don't set SvPADTMP() on PADGV's
Under threaded builds, GVs for OPs are stored in the pad rather than being directly attached to the op. For some reason, all such GV's were getting the SvPADTMP flag set. There seems to be be no good reason for this, and after skipping setting the flag, all tests still pass. The advantage of not setting this flag is that there are quite a few hot places in the code that do if (SvPADTMP(sv) && !IS_PADGV(sv)) { ... I've replaced them all with if (SvPADTMP(sv)) { assert(!IS_PADGV(sv)); ... Since the IS_PADGV() macro expands to something quite heavyweight, this is quite a saving: for example this commit reduces the size of pp_entersub by 111 bytes.
Diffstat (limited to 'regexec.c')
-rw-r--r--regexec.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/regexec.c b/regexec.c
index 6dd029747c..df27193990 100644
--- a/regexec.c
+++ b/regexec.c
@@ -2528,13 +2528,14 @@ Perl_regexec_flags(pTHX_ REGEXP * const rx, char *stringarg, char *strend,
/* see how far we have to get to not match where we matched before */
reginfo->till = stringarg + minend;
- if (prog->extflags & RXf_EVAL_SEEN && SvPADTMP(sv) && !IS_PADGV(sv)) {
+ if (prog->extflags & RXf_EVAL_SEEN && SvPADTMP(sv)) {
/* SAVEFREESV, not sv_mortalcopy, as this SV must last until after
S_cleanup_regmatch_info_aux has executed (registered by
SAVEDESTRUCTOR_X below). S_cleanup_regmatch_info_aux modifies
magic belonging to this SV.
Not newSVsv, either, as it does not COW.
*/
+ assert(!IS_PADGV(sv));
reginfo->sv = newSV(0);
SvSetSV_nosteal(reginfo->sv, sv);
SAVEFREESV(reginfo->sv);