Subject: | [PATCH] better machine code on threaded perl |
see attached path
Subject: | 0001-better-machine-code-on-threaded-perl.patch |
From 9e20ed730b0d417f20b7f765de8fc9ede36a6e8a Mon Sep 17 00:00:00 2001
From: Daniel Dragan <bulk88@hotmail.com>
Date: Sun, 10 May 2015 18:38:29 -0400
Subject: [PATCH] better machine code on threaded perl
croak doesnt require a context param to be pushed on the c stack,
Perl_croak does, since Perl_croak/croak is very rarily called, minimize
the machine code of the error branches
don't do dTHX in thread aware XS code, this just sets up another my_perl
var for the scope of const-xs BOOT sum masking the original declared
my_perl in the outer C scope
---
.../lib/ExtUtils/Constant/ProxySubs.pm | 18 ++++++++----------
1 files changed, 8 insertions(+), 10 deletions(-)
diff --git a/cpan/ExtUtils-Constant/lib/ExtUtils/Constant/ProxySubs.pm b/cpan/ExtUtils-Constant/lib/ExtUtils/Constant/ProxySubs.pm
index 545d322..fcdca22 100644
--- a/cpan/ExtUtils-Constant/lib/ExtUtils/Constant/ProxySubs.pm
+++ b/cpan/ExtUtils-Constant/lib/ExtUtils/Constant/ProxySubs.pm
@@ -268,7 +268,7 @@ EO_NOPCS
SV *sv;
if (!he) {
- Perl_croak($athx "Couldn't add key '%s' to %%$package_sprintf_safe\::",
+ croak("Couldn't add key '%s' to %%$package_sprintf_safe\::",
name);
}
sv = HeVAL(he);
@@ -306,9 +306,8 @@ static int
Im_sorry_Dave(pTHX_ SV *sv, MAGIC *mg)
{
PERL_UNUSED_ARG(mg);
- Perl_croak(aTHX_
- "Your vendor has not defined $package_sprintf_safe macro %"SVf
- " used", sv);
+ croak("Your vendor has not defined $package_sprintf_safe macro %"SVf
+ " used", sv);
NORETURN_FUNCTION_END;
}
@@ -373,7 +372,7 @@ MISSING
print $xs_fh <<"EOBOOT";
BOOT:
{
-#ifdef dTHX
+#if defined(dTHX) && !defined(PERL_NO_GET_CONTEXT)
dTHX;
#endif
HV *symbol_table = get_hv("$symbol_table", GV_ADD);
@@ -491,9 +490,8 @@ EXPLODE
HEK *hek;
#endif
if (!he) {
- Perl_croak($athx
- "Couldn't add key '%s' to %%$package_sprintf_safe\::",
- value_for_notfound->name);
+ croak("Couldn't add key '%s' to %%$package_sprintf_safe\::",
+ value_for_notfound->name);
}
sv = HeVAL(he);
if (!SvOK(sv) && SvTYPE(sv) != SVt_PVGV) {
@@ -521,8 +519,8 @@ EXPLODE
if (!hv_common(${c_subname}_missing, NULL, HEK_KEY(hek),
HEK_LEN(hek), HEK_FLAGS(hek), HV_FETCH_ISSTORE,
&PL_sv_yes, HEK_HASH(hek)))
- Perl_croak($athx "Couldn't add key '%s' to missing_hash",
- value_for_notfound->name);
+ croak("Couldn't add key '%s' to missing_hash",
+ value_for_notfound->name);
#endif
DONT
--
1.7.9.msysgit.0