This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
optimize CLEAR_ERRSV
authorDaniel Dragan <bulk88@hotmail.com>
Fri, 26 Dec 2014 14:15:23 +0000 (09:15 -0500)
committerFather Chrysostomos <sprout@cpan.org>
Sat, 27 Dec 2014 01:33:00 +0000 (17:33 -0800)
commitb4f8d1496ced441d5dcfda7a0f178eff0a71fe4b
tree3845338ae15b2e5d086dee0a9008092f59cbb767
parent470eba0e5823387f90604f7cf9fc354694a0a9ba
optimize CLEAR_ERRSV

-gv_add_by_type is special only for non-GVs, and add AV to GV, otherwise
it is just assigning to GP slot (in this case through GvSV), which
CLEAR_ERRSV already did in another branch, so inline the gv_add_by_type
-dont compute GvSV multiple times, GvSV contains 2 derefs, after this patch
it will contains just 1 deref ("*svp") without an offset (deref without
offset is smaller in x86 machine code than deref with offset)
-SvREFCNT_dec_NN for efficiency
-move SvPOK_only closer to SvMAGICAL, this ensures SvFLAGS is read and
written only once, not 2 reads and 1 write, this is specifically for
RISC-ish cpus
-the goto clresv_newemptypv is because VC optimizer in -O1 didn't combine
the branches

perl521.dll VC 2003 before .text section size in machine code bytes
0xc8a63, after 0xc88e3
perl.h