summaryrefslogtreecommitdiff
path: root/universal.c
diff options
context:
space:
mode:
authorDaniel Dragan <bulk88@hotmail.com>2014-11-08 00:48:58 -0500
committerFather Chrysostomos <sprout@cpan.org>2014-11-07 22:53:52 -0800
commit5513c2cfd695ea6a900a29be8b479bea61614429 (patch)
treea0467ca94fc580eb0436ca771d9bef8dccca3116 /universal.c
parentdb6e00bd00dae7b918216c69bd58fe860e640276 (diff)
downloadperl-5513c2cfd695ea6a900a29be8b479bea61614429.tar.gz
optimize Perl_boot_core_UNIVERSAL and Perl_nextargv
Perl_nextargv fuse 2 tests into 1 Perl_boot_core_UNIVERSAL reorder instructions to avoid using a non-vol registers (save cv across the Safefree), not reread CV body * after Safefree. Compute address of CvFILE once. for Perl_boot_core_UNIVERSAL on VC 2003 before 0x66 bytes of 32 bit x86 machine code, after 0x61.
Diffstat (limited to 'universal.c')
-rw-r--r--universal.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/universal.c b/universal.c
index 94169a6a6e..e1e1a0bb07 100644
--- a/universal.c
+++ b/universal.c
@@ -1049,9 +1049,11 @@ Perl_boot_core_UNIVERSAL(pTHX)
{
CV * const cv =
newCONSTSUB(get_hv("Regexp::", GV_ADD), "DESTROY", NULL);
- Safefree(CvFILE(cv));
- CvFILE(cv) = (char *)file;
+ char ** cvfile = &CvFILE(cv);
+ char * oldfile = *cvfile;
CvDYNFILE_off(cv);
+ *cvfile = (char *)file;
+ Safefree(oldfile);
}
}