This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
reorder MY_CXT_CLONE for less memory reads
authorDaniel Dragan <bulk88@hotmail.com>
Fri, 2 Jan 2015 23:59:06 +0000 (18:59 -0500)
committerFather Chrysostomos <sprout@cpan.org>
Sun, 4 Jan 2015 01:23:32 +0000 (17:23 -0800)
commitccaa51ca2d25cff22173f00be52b55615c358104
treea6b36972138867cc5156e064c9ea41f9981c13ab
parent3c056141580c161da2b1d5f16372900ae9dc9fef
reorder MY_CXT_CLONE for less memory reads

Nn VC 2003 32, taking a very simple CLONE XSUB, specifically
Time::HiRes::CLONE, shows a reduction from 0x53 to 0x47 bytes of machine
code. This is because my_cxt_index has to be reread after the memcpy
function call incase my_cxt_index was changed by memcpy (GCC usually
inlines short fixed length memcpys, on VC P5P perl, the option to inline
memcpy is off), also the new my_cxtp does not need to be saved in a non-vol
anymore, previously my_cxtp had to be copied to a non-vol for it be
available after the memcpy function call. In a simple XSUB like the one
mentioned here, saving and restoring the non-vol register is also
removed.

See details in perl #123534.
perl.h