summaryrefslogtreecommitdiff
path: root/ext/mro
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2014-02-08 17:09:14 -0800
committerFather Chrysostomos <sprout@cpan.org>2014-02-09 11:08:24 -0800
commit65c5495aa9ec4a88c49e80d3be8a94dc896cc0cf (patch)
treeb216ea95e1e21eb01efc1254493d8bf5050b88ac /ext/mro
parent375879aab356d483f8e0e3d339683904de7c01a3 (diff)
downloadperl-65c5495aa9ec4a88c49e80d3be8a94dc896cc0cf.tar.gz
Use HEKfARG in mro.xs
It’s faster to pass the HEK directly instead of creating and throwing away SVs.
Diffstat (limited to 'ext/mro')
-rw-r--r--ext/mro/mro.xs23
1 files changed, 13 insertions, 10 deletions
diff --git a/ext/mro/mro.xs b/ext/mro/mro.xs
index 81539b09f6..fee1c98ed2 100644
--- a/ext/mro/mro.xs
+++ b/ext/mro/mro.xs
@@ -45,8 +45,9 @@ S_mro_get_linear_isa_c3(pTHX_ HV* stash, U32 level)
Perl_croak(aTHX_ "Can't linearize anonymous symbol table");
if (level > 100)
- Perl_croak(aTHX_ "Recursive inheritance detected in package '%"SVf"'",
- SVfARG(sv_2mortal(newSVhek(stashhek))));
+ Perl_croak(aTHX_ "Recursive inheritance detected in package '%"HEKf
+ "'",
+ HEKfARG(stashhek));
meta = HvMROMETA(stash);
@@ -255,9 +256,9 @@ S_mro_get_linear_isa_c3(pTHX_ HV* stash, U32 level)
I32 i;
errmsg = newSVpvf(
- "Inconsistent hierarchy during C3 merge of class '%"SVf"':\n\t"
+ "Inconsistent hierarchy during C3 merge of class '%"HEKf"':\n\t"
"current merge results [\n",
- SVfARG(sv_2mortal(newSVhek(stashhek))));
+ HEKfARG(stashhek));
for (i = 0; i <= av_len(retval); i++) {
SV **elem = av_fetch(retval, i, 0);
sv_catpvf(errmsg, "\t\t%"SVf",\n", SVfARG(*elem));
@@ -588,10 +589,11 @@ mro__nextcan(...)
SV* const val = HeVAL(cache_entry);
if(val == &PL_sv_undef) {
if(throw_nomethod)
- Perl_croak(aTHX_ "No next::method '%"SVf"' found for %"SVf,
+ Perl_croak(aTHX_
+ "No next::method '%"SVf"' found for %"HEKf,
SVfARG(newSVpvn_flags(subname, subname_len,
SVs_TEMP | ( subname_utf8 ? SVf_UTF8 : 0 ) )),
- SVfARG(sv_2mortal(newSVhek( HvNAME_HEK(selfstash) ))));
+ HEKfARG( HvNAME_HEK(selfstash) ));
XSRETURN_EMPTY;
}
mXPUSHs(newRV_inc(val));
@@ -635,9 +637,10 @@ mro__nextcan(...)
if (!curstash) {
if (ckWARN(WARN_SYNTAX))
- Perl_warner(aTHX_ packWARN(WARN_SYNTAX), "Can't locate package %"SVf" for @%"SVf"::ISA",
+ Perl_warner(aTHX_ packWARN(WARN_SYNTAX),
+ "Can't locate package %"SVf" for @%"HEKf"::ISA",
(void*)linear_sv,
- SVfARG(sv_2mortal(newSVhek( HvNAME_HEK(selfstash) ))));
+ HEKfARG( HvNAME_HEK(selfstash) ));
continue;
}
@@ -668,10 +671,10 @@ mro__nextcan(...)
(void)hv_store_ent(nmcache, sv, &PL_sv_undef, 0);
if(throw_nomethod)
- Perl_croak(aTHX_ "No next::method '%"SVf"' found for %"SVf,
+ Perl_croak(aTHX_ "No next::method '%"SVf"' found for %"HEKf,
SVfARG(newSVpvn_flags(subname, subname_len,
SVs_TEMP | ( subname_utf8 ? SVf_UTF8 : 0 ) )),
- SVfARG(sv_2mortal(newSVhek( HvNAME_HEK(selfstash) ))));
+ HEKfARG( HvNAME_HEK(selfstash) ));
XSRETURN_EMPTY;
BOOT: