[Perl/perl5] 39dd28: class.c: store the stash in the constructor CV sta...

2024-06-19 Thread Tony Cook via perl5-changes
  Branch: refs/heads/blead
  Home:   https://github.com/Perl/perl5
  Commit: 39dd28f9eafb1932132c9d1099532d371c913923
  
https://github.com/Perl/perl5/commit/39dd28f9eafb1932132c9d1099532d371c913923
  Author: Tony Cook 
  Date:   2024-06-20 (Thu, 20 Jun 2024)

  Changed paths:
M class.c

  Log Message:
  ---
  class.c: store the stash in the constructor CV stash slot

This code previously stored the stash for the class in the CV's
any_cv slot, and marked that to be released when the CV is released.

But it does not bump the reference count of the stash that I can
see.

When I tried releasing the constructor SV while working on #22169
I found perl would crash, incrementing the stash reference count
prevents that, but leaves us with a reference loop.

But it turns out that CVs already have a slot to store their stash in
and an API that correctly handles reference counting for that slot.

So use CvSTASH_set()/CvSTASH() to manage the stash for "$class::new"
methods.



To unsubscribe from these emails, change your notification settings at 
https://github.com/Perl/perl5/settings/notifications


[Perl/perl5] 765c84: locale.c: Change variable name

2024-06-19 Thread Karl Williamson via perl5-changes
  Branch: refs/heads/blead
  Home:   https://github.com/Perl/perl5
  Commit: 765c84d5b8d80ca3789b98cf4794d86a97b9015b
  
https://github.com/Perl/perl5/commit/765c84d5b8d80ca3789b98cf4794d86a97b9015b
  Author: Karl Williamson 
  Date:   2024-06-19 (Wed, 19 Jun 2024)

  Changed paths:
M locale.c

  Log Message:
  ---
  locale.c: Change variable name

The new one is clearer, especially w.r.t the next commit


  Commit: 86a9c18b6fab1949a26de790418b8b897a71e4ac
  
https://github.com/Perl/perl5/commit/86a9c18b6fab1949a26de790418b8b897a71e4ac
  Author: Karl Williamson 
  Date:   2024-06-19 (Wed, 19 Jun 2024)

  Changed paths:
M embed.fnc
M embed.h
M ext/POSIX/POSIX.xs
M ext/POSIX/lib/POSIX.pm
M locale.c
M pod/perldelta.pod
M proto.h

  Log Message:
  ---
  Fix up and make sv_strftime_ints() public

This enhanced function now allows you to specify if you want the system
to consider the possibility of daylight savings time being in effect.
Formerly, it was never considered.  As a result, the function is good
enough to be made public.


Compare: https://github.com/Perl/perl5/compare/7c3742a47d39...86a9c18b6fab

To unsubscribe from these emails, change your notification settings at 
https://github.com/Perl/perl5/settings/notifications


[Perl/perl5] 7c3742: perlapi: Document opcode typedef

2024-06-19 Thread Karl Williamson via perl5-changes
  Branch: refs/heads/blead
  Home:   https://github.com/Perl/perl5
  Commit: 7c3742a47d39f15a33694556927fca5620aad5a9
  
https://github.com/Perl/perl5/commit/7c3742a47d39f15a33694556927fca5620aad5a9
  Author: Karl Williamson 
  Date:   2024-06-19 (Wed, 19 Jun 2024)

  Changed paths:
M opnames.h
M regen/opcode.pl

  Log Message:
  ---
  perlapi: Document opcode typedef



To unsubscribe from these emails, change your notification settings at 
https://github.com/Perl/perl5/settings/notifications


[Perl/perl5]

2024-06-19 Thread iabyn via perl5-changes
  Branch: refs/heads/davem/padsv_store
  Home:   https://github.com/Perl/perl5

To unsubscribe from these emails, change your notification settings at 
https://github.com/Perl/perl5/settings/notifications


[Perl/perl5] 9a224d: OP_PADSV_STORE: only in void context

2024-06-19 Thread iabyn via perl5-changes
  Branch: refs/heads/blead
  Home:   https://github.com/Perl/perl5
  Commit: 9a224d076a17344e9e851460223544deb2a30532
  
https://github.com/Perl/perl5/commit/9a224d076a17344e9e851460223544deb2a30532
  Author: David Mitchell 
  Date:   2024-06-19 (Wed, 19 Jun 2024)

  Changed paths:
M ext/B/t/optree_varinit.t
M peep.c
M pp_hot.c
M t/perf/opcount.t

  Log Message:
  ---
  OP_PADSV_STORE: only in void context

(The original commit, v5.39.6-108-gc90e7ed39e, was reverted by
v5.39.8-35-gdc524b6cbd, and is now being re-applied. Originally it broke
some CPAN distributions and as it was near code-freeze time and was only
an optimisation, it seemed better to leave it for later. Since we're now
early in the cycle of 5.41.x, there's more time to fix up any fallout.)



For the optimisation which converts $lex  = expr into an OP_PADSV_STORE
op, only optimise if the scalar assign is in VOID context.

This allows us to stop pp_padsv_store() from uselessly pushing the
result onto the stack, only to be immediately popped again by the
following nextstate or unstack op. This becomes more important on
PERL_RC_STACK builds, as each push or pop involves manipulating the SV's
reference count.

I'm working on the assumption that scalar/list/unknown cxt lexical
assigns are rare enough that not optimising them is less of a loss than
optimising the void case. So:

$lex = ; # void:now even faster
$other = $lex = ...; # scalar:  now slow again
foo($lex = ..., );   # list:now slow again

sub {

$lex = ...;  # unknown: now slow again
}



To unsubscribe from these emails, change your notification settings at 
https://github.com/Perl/perl5/settings/notifications


[Perl/perl5] 9f530b: perlfunc: document that sort is stable, remove 'us...

2024-06-19 Thread mauke via perl5-changes
  Branch: refs/heads/blead
  Home:   https://github.com/Perl/perl5
  Commit: 9f530bb96ab848b11ee0439b8b093e0c1887aab9
  
https://github.com/Perl/perl5/commit/9f530bb96ab848b11ee0439b8b093e0c1887aab9
  Author: Lukas Mai 
  Date:   2024-06-19 (Wed, 19 Jun 2024)

  Changed paths:
M pod/perlfunc.pod

  Log Message:
  ---
  perlfunc: document that sort is stable, remove 'use sort' references


  Commit: 9e4e463806821798ca5ea3d9225fe42cce77103d
  
https://github.com/Perl/perl5/commit/9e4e463806821798ca5ea3d9225fe42cce77103d
  Author: Lukas Mai 
  Date:   2024-06-19 (Wed, 19 Jun 2024)

  Changed paths:
M lib/sort.pm

  Log Message:
  ---
  sort: fix display of verbatim blocks by using spaces, not tabs

The `use sort 'defaults';` line used only one tab before the comment;
the other lines had two. This renders inconsistently depending on how
much initial space is used in the output (and where the tab stops are).

For example,  looked like

use sort 'stable';  # guarantee stability
use sort 'defaults';# revert to default behavior
no  sort 'stable';  # stability not important

Using spaces ensures the "#" signs are aligned everywhere.


Compare: https://github.com/Perl/perl5/compare/ff08b60388ee...9e4e46380682

To unsubscribe from these emails, change your notification settings at 
https://github.com/Perl/perl5/settings/notifications


[Perl/perl5] 6c77c0: OP_PADSV_STORE: only in void context

2024-06-19 Thread iabyn via perl5-changes
  Branch: refs/heads/davem/padsv_store
  Home:   https://github.com/Perl/perl5
  Commit: 6c77c095ba2add4b74b70cdbc54c76338152cda8
  
https://github.com/Perl/perl5/commit/6c77c095ba2add4b74b70cdbc54c76338152cda8
  Author: David Mitchell 
  Date:   2024-06-19 (Wed, 19 Jun 2024)

  Changed paths:
M ext/B/t/optree_varinit.t
M peep.c
M pp_hot.c
M t/perf/opcount.t

  Log Message:
  ---
  OP_PADSV_STORE: only in void context

(The original commit, v5.39.6-108-gc90e7ed39e, was reverted by
v5.39.8-35-gdc524b6cbd, and is now being re-applied. Originally it broke
some CPAN distributions and as it was near code-freeze time and was only
an optimisation, it seemed better to leave it for later. Since we're now
early in the cycle of 5.41.x, there's more time to fix up any fallout.)



For the optimisation which converts $lex  = expr into an OP_PADSV_STORE
op, only optimise if the scalar assign is in VOID context.

This allows us to stop pp_padsv_store() from uselessly pushing the
result onto the stack, only to be immediately popped again by the
following nextstate or unstack op. This becomes more important on
PERL_RC_STACK builds, as each push or pop involves manipulating the SV's
reference count.

I'm working on the assumption that scalar/list/unknown cxt lexical
assigns are rare enough that not optimising them is less of a loss than
optimising the void case. So:

$lex = ; # void:now even faster
$other = $lex = ...; # scalar:  now slow again
foo($lex = ..., );   # list:now slow again

sub {

$lex = ...;  # unknown: now slow again
}



To unsubscribe from these emails, change your notification settings at 
https://github.com/Perl/perl5/settings/notifications