summaryrefslogtreecommitdiff
path: root/dist/ExtUtils-ParseXS
diff options
context:
space:
mode:
authorDaniel Dragan <bulk88@hotmail.com>2014-11-08 00:20:52 -0500
committerFather Chrysostomos <sprout@cpan.org>2014-11-07 22:52:22 -0800
commitdb6e00bd00dae7b918216c69bd58fe860e640276 (patch)
treeb812a379126e4f58290cb6f2a9f293aa878abead /dist/ExtUtils-ParseXS
parent6402d4ee6fab9f5d76a131921ef72d686ad7aac5 (diff)
downloadperl-db6e00bd00dae7b918216c69bd58fe860e640276.tar.gz
add xs_handshake API
This API elevates the amount of ABI compatibility protection between XS modules and the interp. It also makes each boot XSUB smaller in machine code by removing function calls and factoring out code into the new Perl_xs_handshake and Perl_xs_epilog functions. sv.c : - revise padlist duping code to reduce code bloat/asserts on DEBUGGING ext/DynaLoader/dlutils.c : - disable version checking so interp startup is faster, ABI mismatches are impossible because DynaLoader is never available as a shared library ext/XS-APItest/XSUB-redefined-macros.xs : - "" means dont check the version, so switch to " " to make the test in xsub_h.t pass, see ML thread "XS_APIVERSION_BOOTCHECK and XS_VERSION is CPP defined but "", mow what?" ext/re/re.xs : - disable API version checking until #123007 is resolved ParseXS/Utilities.pm : 109-standard_XS_defs.t : - remove context from S_croak_xs_usage similar to core commit cb077ed296 . CvGV doesn't need a context until 5.21.4 and commit ae77754ae2 and by then core's croak_xs_uage API has been long available and this backport doesn't need to account for newer perls - fix test where lack of having PERL_IMPLICIT_CONTEXT caused it to fail
Diffstat (limited to 'dist/ExtUtils-ParseXS')
-rw-r--r--dist/ExtUtils-ParseXS/Changes4
-rw-r--r--dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS.pm42
-rw-r--r--dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS/Utilities.pm14
-rw-r--r--dist/ExtUtils-ParseXS/t/109-standard_XS_defs.t3
4 files changed, 38 insertions, 25 deletions
diff --git a/dist/ExtUtils-ParseXS/Changes b/dist/ExtUtils-ParseXS/Changes
index 41966fd1cc..233a8a1302 100644
--- a/dist/ExtUtils-ParseXS/Changes
+++ b/dist/ExtUtils-ParseXS/Changes
@@ -1,5 +1,9 @@
Revision history for Perl extension ExtUtils::ParseXS.
+3.26 - not released yet
+ - Support added for XS handshake API introduced in 5.21.6.
+ - backported S_croak_xs_usage optimized on threaded builds
+
3.24 - Wed Mar 5 18:20:00 CET 2014
- Native Android build fixes
- More lenient syntax for embedded TYPEMAP blocks in XS:
diff --git a/dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS.pm b/dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS.pm
index d63bcc682f..70a6445b16 100644
--- a/dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS.pm
+++ b/dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS.pm
@@ -891,11 +891,13 @@ EOF
print Q(<<"EOF");
#XS_EXTERNAL(boot_$self->{Module_cname}); /* prototype to pass -Wmissing-prototypes */
#XS_EXTERNAL(boot_$self->{Module_cname})
-EOF
-
- print Q(<<"EOF");
#[[
+##if PERL_VERSION_LE(5, 21, 5)
# dVAR; dXSARGS;
+##else
+# dVAR; ${\($self->{WantVersionChk} ?
+ 'dXSBOOTARGSXSAPIVERCHK;' : 'dXSBOOTARGSAPIVERCHK;')}
+##endif
EOF
#Under 5.8.x and lower, newXS is declared in proto.h as expecting a non-const
@@ -916,15 +918,26 @@ EOF
print Q(<<"EOF");
# PERL_UNUSED_VAR(cv); /* -W */
# PERL_UNUSED_VAR(items); /* -W */
-##ifdef XS_APIVERSION_BOOTCHECK
+EOF
+
+ if( $self->{WantVersionChk}){
+ print Q(<<"EOF") ;
+##if PERL_VERSION_LE(5, 21, 5)
+# XS_VERSION_BOOTCHECK;
+## ifdef XS_APIVERSION_BOOTCHECK
# XS_APIVERSION_BOOTCHECK;
+## endif
##endif
+
EOF
+ } else {
+ print Q(<<"EOF") ;
+##if PERL_VERSION_LE(5, 21, 5) && defined(XS_APIVERSION_BOOTCHECK)
+# XS_APIVERSION_BOOTCHECK;
+##endif
- print Q(<<"EOF") if $self->{WantVersionChk};
-# XS_VERSION_BOOTCHECK;
-#
EOF
+ }
print Q(<<"EOF") if defined $self->{XsubAliases} or defined $self->{interfaces};
# {
@@ -960,14 +973,15 @@ EOF
}
print Q(<<'EOF');
-##if (PERL_REVISION == 5 && PERL_VERSION >= 9)
-# if (PL_unitcheckav)
-# call_list(PL_scopestack_ix, PL_unitcheckav);
-##endif
-EOF
-
- print Q(<<"EOF");
+##if PERL_VERSION_LE(5, 21, 5)
+## if PERL_VERSION_GE(5, 9, 0)
+# if (PL_unitcheckav)
+# call_list(PL_scopestack_ix, PL_unitcheckav);
+## endif
# XSRETURN_YES;
+##else
+# Perl_xs_boot_epilog(aTHX_ ax);
+##endif
#]]
#
EOF
diff --git a/dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS/Utilities.pm b/dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS/Utilities.pm
index 1a1f171d9c..7f957595fd 100644
--- a/dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS/Utilities.pm
+++ b/dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS/Utilities.pm
@@ -453,10 +453,10 @@ EOF
/* prototype to pass -Wmissing-prototypes */
STATIC void
-S_croak_xs_usage(pTHX_ const CV *const cv, const char *const params);
+S_croak_xs_usage(const CV *const cv, const char *const params);
STATIC void
-S_croak_xs_usage(pTHX_ const CV *const cv, const char *const params)
+S_croak_xs_usage(const CV *const cv, const char *const params)
{
const GV *const gv = CvGV(cv);
@@ -468,21 +468,17 @@ S_croak_xs_usage(pTHX_ const CV *const cv, const char *const params)
const char *const hvname = stash ? HvNAME(stash) : NULL;
if (hvname)
- Perl_croak(aTHX_ "Usage: %s::%s(%s)", hvname, gvname, params);
+ Perl_croak_nocontext("Usage: %s::%s(%s)", hvname, gvname, params);
else
- Perl_croak(aTHX_ "Usage: %s(%s)", gvname, params);
+ Perl_croak_nocontext("Usage: %s(%s)", gvname, params);
} else {
/* Pants. I don't think that it should be possible to get here. */
- Perl_croak(aTHX_ "Usage: CODE(0x%"UVxf")(%s)", PTR2UV(cv), params);
+ Perl_croak_nocontext("Usage: CODE(0x%"UVxf")(%s)", PTR2UV(cv), params);
}
}
#undef PERL_ARGS_ASSERT_CROAK_XS_USAGE
-#ifdef PERL_IMPLICIT_CONTEXT
-#define croak_xs_usage(a,b) S_croak_xs_usage(aTHX_ a,b)
-#else
#define croak_xs_usage S_croak_xs_usage
-#endif
#endif
diff --git a/dist/ExtUtils-ParseXS/t/109-standard_XS_defs.t b/dist/ExtUtils-ParseXS/t/109-standard_XS_defs.t
index 0d11c47841..da039205e3 100644
--- a/dist/ExtUtils-ParseXS/t/109-standard_XS_defs.t
+++ b/dist/ExtUtils-ParseXS/t/109-standard_XS_defs.t
@@ -2,7 +2,7 @@
use strict;
use warnings;
$| = 1;
-use Test::More tests => 5;
+use Test::More tests => 4;
use File::Spec;
use lib (-d 't' ? File::Spec->catdir(qw(t lib)) : 'lib');
use ExtUtils::ParseXS::Utilities qw(
@@ -13,7 +13,6 @@ use PrimitiveCapture;
my @statements = (
'#ifndef PERL_UNUSED_VAR',
'#ifndef PERL_ARGS_ASSERT_CROAK_XS_USAGE',
- '#ifdef PERL_IMPLICIT_CONTEXT',
'#ifdef newXS_flags',
);