New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
optimize macro dXSARGS #7753
Comments
From skv@protey.ruCurrently dXSARGS is defined as I offer to replace "dMARK; dAX;" with new macro "dAXMARK;" Sequence "dMARK; dAX;" is expanded as: New macro dAXMARK optmize it via reducing by one "subtract" operation (and Also this patch replaces sequence "dMARK; dAX;" in universal.c in functions Offered optimization is clear and obvious. Inline Patch--- XSUB.h.orig 2005-01-16 20:29:03.031000000 +0300
+++ XSUB.h 2005-01-16 20:47:27.250000000 +0300
@@ -52,6 +52,9 @@
=for apidoc Ams||dAX
Sets up the C<ax> variable.
+
+=for apidoc Ams||dAXMARK
+Sets up the C<ax> variable and stack marker variable C<mark>.
This is usually handled automatically by C<xsubpp> by calling C<dXSARGS>.
=for apidoc Ams||dITEMS
@@ -80,11 +83,14 @@
#define dAX I32 ax = MARK - PL_stack_base + 1
+#define dAXMARK \
+ I32 ax = POPMARK; \
+ register SV **mark = PL_stack_base + ax++
+
#define dITEMS I32 items = SP - MARK
#define dXSARGS \
- dSP; dMARK; \
- dAX; dITEMS
+ dSP; dAXMARK; dITEMS
#define dXSTARG SV * targ = ((PL_op->op_private & OPpENTERSUB_HASTARG) \
? PAD_SV(PL_op->op_targ) : sv_newmortal())
--- universal.c.orig 2005-01-16 20:44:50.640625000 +0300
+++ universal.c 2005-01-16 20:45:03.656250000 +0300
@@ -690,7 +690,7 @@
{
/* Using dXSARGS would also have dITEM and dSP,
* which define 2 unused local variables. */
- dMARK; dAX;
+ dAXMARK;
XSRETURN_UV(PERL_HASH_SEED);
}
@@ -698,7 +698,7 @@
{
/* Using dXSARGS would also have dITEM and dSP,
* which define 2 unused local variables. */
- dMARK; dAX;
+ dAXMARK;
XSRETURN_UV(PL_rehash_seed);
}
-- Sergey Skvortsov |
From @smpeters
It appears that this ticket has been warnocked. Does this make any Steve Peters |
The RT System itself - Status changed from 'new' to 'open' |
@rgs - Status changed from 'open' to 'resolved' |
From @rgsSergey Skvortsov (via RT) wrote:
Thanks for this patch; I've applied it against the development branch |
Migrated from rt.perl.org#33809 (status was 'resolved')
Searchable as RT33809$
The text was updated successfully, but these errors were encountered: