diff options
author | Daniel Dragan <bulk88@hotmail.com> | 2012-11-12 00:04:00 -0500 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2012-11-12 06:17:36 -0800 |
commit | cb077ed29694c30e42772d2c1fc2d9a9b3183eca (patch) | |
tree | d8af4ba26da3f83b7425214465b2c7d6fc28dd3b /av.c | |
parent | 18c931a3833eccac01983e3e50239ca36de82ec4 (diff) | |
download | perl-cb077ed29694c30e42772d2c1fc2d9a9b3183eca.tar.gz |
rmv context from Perl_croak_no_modify and Perl_croak_xs_usage
Remove the context/pTHX from Perl_croak_no_modify and Perl_croak_xs_usage.
For croak_no_modify, it now has no parameters (and always has been
no return), and on some compilers will now be optimized to a conditional
jump. For Perl_croak_xs_usage one push asm opcode is removed at the caller.
For both funcs, their footprint in their callers (which probably are hot
code) is smaller, which means a tiny bit more room in the cache. My text
section went from 0xC1A2F to 0xC198F after apply this. Also see
http://www.nntp.perl.org/group/perl.perl5.porters/2012/11/msg195233.html .
Diffstat (limited to 'av.c')
-rw-r--r-- | av.c | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -345,7 +345,7 @@ Perl_av_store(pTHX_ register AV *av, I32 key, SV *val) } if (SvREADONLY(av) && key >= AvFILL(av)) - Perl_croak_no_modify(aTHX); + Perl_croak_no_modify(); if (!AvREAL(av) && AvREIFY(av)) av_reify(av); @@ -463,7 +463,7 @@ Perl_av_clear(pTHX_ register AV *av) #endif if (SvREADONLY(av)) - Perl_croak_no_modify(aTHX); + Perl_croak_no_modify(); /* Give any tie a chance to cleanup first */ if (SvRMAGICAL(av)) { @@ -579,7 +579,7 @@ Perl_av_push(pTHX_ register AV *av, SV *val) assert(SvTYPE(av) == SVt_PVAV); if (SvREADONLY(av)) - Perl_croak_no_modify(aTHX); + Perl_croak_no_modify(); if ((mg = SvTIED_mg((const SV *)av, PERL_MAGIC_tied))) { Perl_magic_methcall(aTHX_ MUTABLE_SV(av), mg, "PUSH", G_DISCARD, 1, @@ -611,7 +611,7 @@ Perl_av_pop(pTHX_ register AV *av) assert(SvTYPE(av) == SVt_PVAV); if (SvREADONLY(av)) - Perl_croak_no_modify(aTHX); + Perl_croak_no_modify(); if ((mg = SvTIED_mg((const SV *)av, PERL_MAGIC_tied))) { retval = Perl_magic_methcall(aTHX_ MUTABLE_SV(av), mg, "POP", 0, 0); if (retval) @@ -672,7 +672,7 @@ Perl_av_unshift(pTHX_ register AV *av, register I32 num) assert(SvTYPE(av) == SVt_PVAV); if (SvREADONLY(av)) - Perl_croak_no_modify(aTHX); + Perl_croak_no_modify(); if ((mg = SvTIED_mg((const SV *)av, PERL_MAGIC_tied))) { Perl_magic_methcall(aTHX_ MUTABLE_SV(av), mg, "UNSHIFT", @@ -737,7 +737,7 @@ Perl_av_shift(pTHX_ register AV *av) assert(SvTYPE(av) == SVt_PVAV); if (SvREADONLY(av)) - Perl_croak_no_modify(aTHX); + Perl_croak_no_modify(); if ((mg = SvTIED_mg((const SV *)av, PERL_MAGIC_tied))) { retval = Perl_magic_methcall(aTHX_ MUTABLE_SV(av), mg, "SHIFT", 0, 0); if (retval) @@ -853,7 +853,7 @@ Perl_av_delete(pTHX_ AV *av, I32 key, I32 flags) assert(SvTYPE(av) == SVt_PVAV); if (SvREADONLY(av)) - Perl_croak_no_modify(aTHX); + Perl_croak_no_modify(); if (SvRMAGICAL(av)) { const MAGIC * const tied_magic |