Branch: refs/heads/blead
Home: https://github.com/Perl/perl5
Commit: b5473a226cd4935bb89d350146ca093b98580f90
https://github.com/Perl/perl5/commit/b5473a226cd4935bb89d350146ca093b98580f90
Author: David Mitchell <[email protected]>
Date: 2024-08-23 (Fri, 23 Aug 2024)
Changed paths:
M dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS.pm
Log Message:
-----------
ParseXS: generate_init(): fetch typemap once
The code in generate_init() currently looks up the typemap entry for the
passed type, and if not present, errors out. Almost immediately
afterwards it looks up the value again, this time to use.
This commit makes it do the lookup only once. It also renames the
$typem variable to $typemap for easier reading.
Should be no functional changes.
Commit: d80742e37ca966e26258def1765169ad01b5fa1f
https://github.com/Perl/perl5/commit/d80742e37ca966e26258def1765169ad01b5fa1f
Author: David Mitchell <[email protected]>
Date: 2024-08-23 (Fri, 23 Aug 2024)
Changed paths:
M dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS.pm
Log Message:
-----------
ParseXS: generate_output(): rm long else block
Change
if (...) {
...
}
else {
... long block ...
}
to
if (...) {
...
return;
}
... long block ...
The next commit will re-indent the long block.
No functional changes.
Commit: a7ae018572077ab946a6a1b75e4421c9fa7e6b39
https://github.com/Perl/perl5/commit/a7ae018572077ab946a6a1b75e4421c9fa7e6b39
Author: David Mitchell <[email protected]>
Date: 2024-08-23 (Fri, 23 Aug 2024)
Changed paths:
M dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS.pm
Log Message:
-----------
ParseXS: generate_output(): reindent
Re-indent a block of code after previous commit removed a scope.
Whitespace-only.
Commit: b4377d82e58b1bebb4f6c58b007b48d884ecdc08
https://github.com/Perl/perl5/commit/b4377d82e58b1bebb4f6c58b007b48d884ecdc08
Author: David Mitchell <[email protected]>
Date: 2024-08-23 (Fri, 23 Aug 2024)
Changed paths:
M dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS.pm
Log Message:
-----------
ParseXS: generate_output(): do indent-depth better
One of the things generate_output() does is optionally wrap a chunk
of code it outputs in a block with an extra variable declaration.
This was handled a bit clumsily by doing the conditional extra indent
at every print statement and doing the '{' and '}' emitting at the start
and end in two different places.
Instead, change all the 'print ...' to 'push @lines, ...'
and consolidate all the 'wrap in a block and further indent' logic at
the end in one place.
Makes the code simpler and easier to comprehend.
There should be no change in functionality, except conceivably a slight
change to how mixed tab-and-space indentation is output for a typemap.
The .c files generated from all the .xs files in bleadperl are currently
unchanged.
Commit: dd3a8df07587789027cfb49e8e9d7da608a1de1c
https://github.com/Perl/perl5/commit/dd3a8df07587789027cfb49e8e9d7da608a1de1c
Author: David Mitchell <[email protected]>
Date: 2024-08-23 (Fri, 23 Aug 2024)
Changed paths:
M dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS.pm
Log Message:
-----------
ParseXS: generate_output(): simplify some code
Assign the expression ($use_RETVALSV ? 'SV':'') to a variable rather
than repeatedly using the expression. Makes the code easier to read.
No functional changes.
Commit: 2ef1da57d4ee673b6a111e1e810f6b918a2ceafd
https://github.com/Perl/perl5/commit/2ef1da57d4ee673b6a111e1e810f6b918a2ceafd
Author: David Mitchell <[email protected]>
Date: 2024-08-23 (Fri, 23 Aug 2024)
Changed paths:
M dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS.pm
Log Message:
-----------
ParseXS: generate_output(): remove some local's
The local()s here don't add any functionality because the values
being changed are only used once for the typemap eval and then
discarded. So remove them.
Should be no functional changes.
Commit: f9353aa850ad4dce4fe500c410f9438c0611b51d
https://github.com/Perl/perl5/commit/f9353aa850ad4dce4fe500c410f9438c0611b51d
Author: David Mitchell <[email protected]>
Date: 2024-08-23 (Fri, 23 Aug 2024)
Changed paths:
M dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS.pm
Log Message:
-----------
ParseXS: generate_output(): remove dead code
An 'if' branch is never taken. Delete it. The copious code comments also
being deleted by this commit explain how this came to be a dead branch.
Commit: 9c882bca89b681ec78891723df938516d1a4a6a3
https://github.com/Perl/perl5/commit/9c882bca89b681ec78891723df938516d1a4a6a3
Author: David Mitchell <[email protected]>
Date: 2024-08-23 (Fri, 23 Aug 2024)
Changed paths:
M dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS.pm
Log Message:
-----------
ParseXS: generate_output(): use \b in /RETVALSV/
A couple of places in this function do s/RETVALSV/.../. These are
attempting to fix up a typemap template that has already being expanded
using $var = 'RETVALSV'.
Change these to s/\bRETVALSV\b/.../ to be more precise. It's extremely
unlikely that the original mistake ever broke anything, but now it's
even less likely to break: it now only breaks if the typemap includes
the word RETVALSV somewhere, rather than a word which includes RETVALSV.
Commit: 053aa1576c1536ac36f9ff2e1349b19f3f322274
https://github.com/Perl/perl5/commit/053aa1576c1536ac36f9ff2e1349b19f3f322274
Author: David Mitchell <[email protected]>
Date: 2024-08-23 (Fri, 23 Aug 2024)
Changed paths:
M dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS.pm
Log Message:
-----------
ParseXS: generate_output(): use \s* in a pattern
There's a minor optimisation which skips emitting a typemap line if
it expands to 'RETVAL = RETVAL;'. This commit makes the pattern looking
for this use \s* rather than fixed spacing, so it might spot more cases
of this.
This is trivial: even if the redundant code is emitted, any decent
optimising C compiler is going to skip it anyway.
Commit: 4f48ba6bc06248f97f203dd6340e7977bdb197fa
https://github.com/Perl/perl5/commit/4f48ba6bc06248f97f203dd6340e7977bdb197fa
Author: David Mitchell <[email protected]>
Date: 2024-08-23 (Fri, 23 Aug 2024)
Changed paths:
M dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS.pm
Log Message:
-----------
ParseXS: generate_output(): invert a !~
Change
if (foo !~ /bar/) {
do something common
}
to
unless (foo =~ /bar/) {
do something common
}
to emphasise that we normally do this, unless ...
Commit: 5589b6a5e10c33d0f6d7af0f8e5940937aff69c4
https://github.com/Perl/perl5/commit/5589b6a5e10c33d0f6d7af0f8e5940937aff69c4
Author: David Mitchell <[email protected]>
Date: 2024-08-23 (Fri, 23 Aug 2024)
Changed paths:
M dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS.pm
Log Message:
-----------
ParseXS: generate_output(): add $want_newmortal
Replace the $pre_expr var (which says what to add) with a new
$want_newmortal bool var which says what to do rather than just
containing a string which will emit code which does what you want.
A trivial change which doesn't effect functionality but makes the code
slightly easier to follow.
Commit: 01ed21205b0bca290f55df63a3b539283573e2e2
https://github.com/Perl/perl5/commit/01ed21205b0bca290f55df63a3b539283573e2e2
Author: David Mitchell <[email protected]>
Date: 2024-08-23 (Fri, 23 Aug 2024)
Changed paths:
M dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS.pm
Log Message:
-----------
ParseXS: generate_output(): tweak immortal test
There's a regex which looks at whether an expanded typemap assigns
a value to the var which is guaranteed to be immortal. This allows an
optimisation. (False negatives are safe but slower. False positives are
dangerous.)
Update this pattern to:
- use //x;
- split it into multiple lines for readability;
- change the ^\t to ^\s* to that it's more likely to match a typemap
with weird spacing;
- include matching a closing ) on a boolSV() call
- include /..$/ anchoring to avoid any strange extra thing at the end of
the typmap being missed and triggering a false positive (unlikely but
better safe than sorry);
- recognise PL_sv_zero as another immortal. It's very unlikely that that
PL_sv_zero actually appears in any typemap in the real world, but we
might as well add it for completeness.
This patten still isn't perfect: it doesn't parse the body of the boolSV
call, so in theory something like this could trigger a false positive:
$arg = boolSV(....) == &PL_sv_undef ? "undef" : foo();
But that's fairly unlikely.
Commit: a9dcb3354f6dfae6b3f281277c997f2d773f3536
https://github.com/Perl/perl5/commit/a9dcb3354f6dfae6b3f281277c997f2d773f3536
Author: David Mitchell <[email protected]>
Date: 2024-08-23 (Fri, 23 Aug 2024)
Changed paths:
M dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS.pm
Log Message:
-----------
ParseXS: generate_output(): change branch nesting
Change the nesting of a couple of branches. No functional changes.
Change this:
if (/Foo plus a special case/) {
do an optimisation involving Foo
}
elsif (/Foo/) {
do Foo
}
elsif (...)
to this:
if (/Foo/) {
if (/Foo plus a special case/) {
do an optimisation involving Foo
}
else {
do Foo
}
elsif (...)
This means that the major branches are solely for detecting the basic
varieties of typemap, while an optimisation for one of those varieties is
handled within that major branch.
The diff looks bigger than it is - all the blocks of code within each
conditional are unchanged.
Commit: 4323ab6c72b91621568ea7eca00369e31fa6151b
https://github.com/Perl/perl5/commit/4323ab6c72b91621568ea7eca00369e31fa6151b
Author: David Mitchell <[email protected]>
Date: 2024-08-23 (Fri, 23 Aug 2024)
Changed paths:
M dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS.pm
Log Message:
-----------
ParseXS: generate_output(): change ST(0)= logic
Remove the $do_copy_tmp lex var and add a $ST0_already_assigned_to
lex var.
When deciding whether to emit
ST(0) = ...
that decision should be based on whether the expanded typemap already
includes such an assignment. (Often it doesn't, because various
optimisations change it to 'RETVALSV = ' etc.)
This commit sets a variable which directly states whether this is true,
instead of relying on indirect state.
This commit should provide no change in functionality, but it makes the
code more robust against future changes, by not having to rely on all
branches knowing to set all the correct indirect variable values.
Commit: ad7f2399b9b749c6b1315db0863593b3214a3b61
https://github.com/Perl/perl5/commit/ad7f2399b9b749c6b1315db0863593b3214a3b61
Author: David Mitchell <[email protected]>
Date: 2024-08-23 (Fri, 23 Aug 2024)
Changed paths:
M dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS.pm
Log Message:
-----------
ParseXS: generate_output(): rename $do_mortal
Rename the lexical var $do_mortal to $do_mortalize to better reflect
that it indicates that 'sv_2mortal()' code should be emitted (as opposed
to, for example creating a new mortal).
Compare: https://github.com/Perl/perl5/compare/190f32581b05...ad7f2399b9b7
To unsubscribe from these emails, change your notification settings at
https://github.com/Perl/perl5/settings/notifications