[Perl/perl5] 5efadf: Perldeltas for GH#21351 & GH#21265

2023-09-02 Thread Richard Leach via perl5-changes
  Branch: refs/heads/blead
  Home:   https://github.com/Perl/perl5
  Commit: 5efadf9a6aaf15307a7bc0038b678e403e5ba562
  
https://github.com/Perl/perl5/commit/5efadf9a6aaf15307a7bc0038b678e403e5ba562
  Author: Richard Leach 
  Date:   2023-09-02 (Sat, 02 Sep 2023)

  Changed paths:
M pod/perldelta.pod

  Log Message:
  ---
  Perldeltas for GH#21351 & GH#21265




[Perl/perl5] 361850: silence warning in svleak.t

2023-09-02 Thread iabyn via perl5-changes
  Branch: refs/heads/blead
  Home:   https://github.com/Perl/perl5
  Commit: 361850e25fd106bc1f68b0ee5549e32df4bc041c
  
https://github.com/Perl/perl5/commit/361850e25fd106bc1f68b0ee5549e32df4bc041c
  Author: David Mitchell 
  Date:   2023-09-02 (Sat, 02 Sep 2023)

  Changed paths:
M t/op/svleak.t

  Log Message:
  ---
  silence warning in svleak.t

A recently added smartmatch test was triggering a 'deprecated' warning.




[Perl/perl5]

2023-09-02 Thread iabyn via perl5-changes
  Branch: refs/heads/davem/mg_concat
  Home:   https://github.com/Perl/perl5


[Perl/perl5] f37cd5: perf/benchmarks: add concat tests for magic vars

2023-09-02 Thread iabyn via perl5-changes
  Branch: refs/heads/blead
  Home:   https://github.com/Perl/perl5
  Commit: f37cd5e9bc43e0d839b4007ceefca5a02c4701c6
  
https://github.com/Perl/perl5/commit/f37cd5e9bc43e0d839b4007ceefca5a02c4701c6
  Author: David Mitchell 
  Date:   2023-09-02 (Sat, 02 Sep 2023)

  Changed paths:
M t/perf/benchmarks

  Log Message:
  ---
  perf/benchmarks: add concat tests for magic vars

There are already extensive tests for various permutations of string
concatenation (mainly to exercise the pp_multiconcat() optimisation
introduced in 5.28.0)

This commit adds copies of of most of those tests, but where lexical
vars are replaced by a variable which has get magic, in this case $1.

pp_multiconcat() takes a very pessimised approach when it detects magic
vars (the possible side effects  of which rule out most of the possible
optimisations, mainly due to ordering). But it's been pointed out
(GH #21360) that this can make expressions involving such vars actually
slower than before pp_multiconcat() was introduced.

So add tests now, then subsequent commits will try to speed them up.


  Commit: 212b6b3f3b2c904f656295bc1871a735c9589ceb
  
https://github.com/Perl/perl5/commit/212b6b3f3b2c904f656295bc1871a735c9589ceb
  Author: David Mitchell 
  Date:   2023-09-02 (Sat, 02 Sep 2023)

  Changed paths:
M pp_hot.c

  Log Message:
  ---
  pp_multiconcat(): use a single TEMP for consts

In the 'fallback to traditional concat behaviour if any args are magic'
branch, the code creates an SvTEMP() SV for each constant string segment
that needs to be concatenated.

This commit makes it reuse the same TEMP for each constant segment,
rather than creating a new one each time.

The code originally reused the TEMP, but that broke things where the
method which was called for an overloaded object took a reference to one
of its args (RT #132385). My original fix was a blanket "don't reuse".
This commit makes the rule into "reuse unless the TEMP has a refcount > 1,
in which case abandon it", which shou;d make things faster.

See GH #21360.


  Commit: ea6e0ec28eeb0c56edbc0e88c5337efb1b17bda0
  
https://github.com/Perl/perl5/commit/ea6e0ec28eeb0c56edbc0e88c5337efb1b17bda0
  Author: David Mitchell 
  Date:   2023-09-02 (Sat, 02 Sep 2023)

  Changed paths:
M pp_hot.c

  Log Message:
  ---
  pp_multiconcat(): use shared-buffer const SV

In the 'fallback to traditional concat behaviour if any args are magic'
branch, the code creates a resuable SvTEMP() SV, which is temporarily
set for each constant string segment that needs to be concatenated.

Make that SV be of the kind where SvLEN(sv) == 0, which means the PV
buffer is shared and won't be freed when the SV is freed. Then just set
the SvPV pointer to point to the appropriate offset in the string
constants buffer attached to the multiconcat op. This avoids malloc()ing
and free()ing the PV buffer each time, and so should speed things up.

See GH #21360.


  Commit: e3777abb2629e5b080a66f5f2b52bd980a47c4c1
  
https://github.com/Perl/perl5/commit/e3777abb2629e5b080a66f5f2b52bd980a47c4c1
  Author: David Mitchell 
  Date:   2023-09-02 (Sat, 02 Sep 2023)

  Changed paths:
M ext/B/B.pm
M ext/B/B.xs
M peep.c
M perl.h
M pp_hot.c

  Log Message:
  ---
  pp_multiconcat(): use PADTMPs for magic stuff

In the 'fallback to traditional concat behaviour if any args are magic'
branch, the code creates up to four SvTEMP() SVs to emulate the PADTMPs
of the various OP_CONCAT, OP_CONST, etc ops it replaced.

This commit allocates up to three extra PADTMPs (indexed from the aux
array) for pp_multiconcat()'s use, to avoid having to allocate and free
SvTEMPs each time.

It also fixes the issue in GH #21360, whereby something like

s//x$1/g

was allocating SvTEMPs for each /g iteration, but because it only does a
FREETMPs after the last iteration, memory usage grew and performance
suffered.

After this commit, only two places still create a mortal.
The first is in the tie/overload handling code (which emulates
Perl_try_amagic_bin) for the rare case of both args being magic and the
same SV. Before pp_multiconcat() was added, this would create a mortal
anyway.

The seconds is in the rare case where a PADTMP used to emulate the SV
of an OP_CONST is stolen (e.g. by an overload method taking a reference
to it.) In this case it is abandoned and a mortal used instead.

The idea to add extra PADTMPs, indexed from aux, was stolen from Richard
Leach.


  Commit: 7bcd18ae82e8d5258145a748ee206ff8325dbd74
  
https://github.com/Perl/perl5/commit/7bcd18ae82e8d5258145a748ee206ff8325dbd74
  Author: David Mitchell 
  Date:   2023-09-02 (Sat, 02 Sep 2023)

  Changed paths:
M ext/B/B.pm
M ext/B/B.xs
M peep.c
M perl.h
M pp_hot.c
M t/perf/benchmarks

  Log Message:
  ---
  [MERGE] pp_multiconcat: don't make lots of mortals

In the 'fallback to traditional concat behaviour if any args are magic'
branch, the code was 

[Perl/perl5] 71cb15: make RC-stack-aware: unwrap nullary pp() fns

2023-09-02 Thread iabyn via perl5-changes
  Branch: refs/heads/davem/rc_stack2
  Home:   https://github.com/Perl/perl5
  Commit: 71cb155c51db3d871f75f8cee9d3d584596f9378
  
https://github.com/Perl/perl5/commit/71cb155c51db3d871f75f8cee9d3d584596f9378
  Author: David Mitchell 
  Date:   2023-09-02 (Sat, 02 Sep 2023)

  Changed paths:
M pp.c
M pp_ctl.c
M pp_hot.c
M pp_sys.c

  Log Message:
  ---
  make RC-stack-aware: unwrap nullary pp() fns

Remove the temporary wrappers from most of the pp() functions which
take zero arguments from the stack (but which may well return
arguments).

Only the simple nullary OPs have been unwrapped in this commit; more
complex ones will have their own commit.


  Commit: 03a64f1cf5e02bc5b363228a6a16ee4411f4d4f1
  
https://github.com/Perl/perl5/commit/03a64f1cf5e02bc5b363228a6a16ee4411f4d4f1
  Author: David Mitchell 
  Date:   2023-09-02 (Sat, 02 Sep 2023)

  Changed paths:
M doop.c
M embed.fnc
M hv.c
M pp.c
M pp_hot.c
M proto.h

  Log Message:
  ---
  make RC-stack-aware: unwrap rv2av etc pp fns

Remove the temporary wrappers from a set of pp() functions which
handle retrieving the whole contents of an array or hash. These needed
to be done as one commit because there's a lot of shared static
functions etc that all need to be changed at the same time.

The unwrapped pp() functions are:

do_kv(a.k.a. pp_keys, pp_values)
pp_rv2sv
pp_padrange
pp_padav
pp_padhv
pp_rv2av (a.k.a. pp_rv2hv)
pp_lvavref

In addition the following static or non-public functions were fixed and
changed:

Perl_hv_pushkv
S_padhv_rv2hv_common  - it's now responsible for popping arg
Perl_softref2xv   - its signature has changed.


  Commit: 9f480e1758aa73fc320bc8d7e7a8498312a05c39
  
https://github.com/Perl/perl5/commit/9f480e1758aa73fc320bc8d7e7a8498312a05c39
  Author: David Mitchell 
  Date:   2023-09-02 (Sat, 02 Sep 2023)

  Changed paths:
M pp.c
M pp_hot.c

  Log Message:
  ---
  make RC-stack-aware: unwrap unary pp() fns

Remove the temporary wrappers from many of the pp() functions which
take a single argument from the stack.

Only the simple unary OPs have been unwrapped in this commit; more
complex ones will come later.


  Commit: 7bc913e2dbdf6733b1f777da6293d24d6d0efcbf
  
https://github.com/Perl/perl5/commit/7bc913e2dbdf6733b1f777da6293d24d6d0efcbf
  Author: David Mitchell 
  Date:   2023-09-02 (Sat, 02 Sep 2023)

  Changed paths:
M builtin.c
M pp.c

  Log Message:
  ---
  make RC-stack-aware: unwrap builtin pp() fns

Remove the temporary wrappers from the pp() functions which
implement some of the functionality of the builtin:: namespace.

All of these had to be done as a single commit, because a couple
of XS functions which implement many of the builtin subs need to be made
RC-stack-aware at the same time as all the associated pp() functions,
since those pp() functions are tail-called by the XS functions.


  Commit: 63b07e5cbb57d49204ee8864f27fc36b0f770931
  
https://github.com/Perl/perl5/commit/63b07e5cbb57d49204ee8864f27fc36b0f770931
  Author: David Mitchell 
  Date:   2023-09-02 (Sat, 02 Sep 2023)

  Changed paths:
M pp.c
M pp_ctl.c
M pp_hot.c

  Log Message:
  ---
  make RC-stack-aware: unwrap binary pp() fns

Remove the temporary wrappers from many of the pp() functions which
take two arguments from the stack.

Only the simpler binary OPs have been unwrapped in this commit; more
complex ones will come later.


Compare: https://github.com/Perl/perl5/compare/71cb155c51db%5E...63b07e5cbb57


[Perl/perl5] 885c33: Make ExtUtils::CBuilder throw an exception on Wind...

2023-09-02 Thread Leon Timmermans via perl5-changes
  Branch: refs/heads/leont/eucb-windows-errors
  Home:   https://github.com/Perl/perl5
  Commit: 885c333e4295a288d63bc59b6753619243bc813a
  
https://github.com/Perl/perl5/commit/885c333e4295a288d63bc59b6753619243bc813a
  Author: Leon Timmermans 
  Date:   2023-09-02 (Sat, 02 Sep 2023)

  Changed paths:
M dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder.pm
M dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Base.pm
M dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/Unix.pm
M dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/VMS.pm
M dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/Windows.pm
M dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/Windows/BCC.pm
M dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/Windows/GCC.pm
M dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/Windows/MSVC.pm
M dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/aix.pm
M dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/android.pm
M dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/cygwin.pm
M dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/darwin.pm
M dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/dec_osf.pm
M dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/os2.pm

  Log Message:
  ---
  Make ExtUtils::CBuilder throw an exception on Windows on linker errors




[Perl/perl5] abc9d3: Update ExtUtils::ParseXS Changes file

2023-09-02 Thread Leon Timmermans via perl5-changes
  Branch: refs/heads/blead
  Home:   https://github.com/Perl/perl5
  Commit: abc9d33b5dc51ac286480857c588e0c22abb41d4
  
https://github.com/Perl/perl5/commit/abc9d33b5dc51ac286480857c588e0c22abb41d4
  Author: Leon Timmermans 
  Date:   2023-09-02 (Sat, 02 Sep 2023)

  Changed paths:
M dist/ExtUtils-ParseXS/Changes

  Log Message:
  ---
  Update ExtUtils::ParseXS Changes file