[Perl/perl5] 6e09b8: Enable `use feature 'module_true'`

2022-10-31 Thread Yves Orton via perl5-changes
  Branch: refs/heads/yves/chr_rfc-18-module-true
  Home:   https://github.com/Perl/perl5
  Commit: 6e09b84ae1b0abb15b22d8ebf980edd4acb82b94
  
https://github.com/Perl/perl5/commit/6e09b84ae1b0abb15b22d8ebf980edd4acb82b94
  Author: chromatic 
  Date:   2022-10-31 (Mon, 31 Oct 2022)

  Changed paths:
M feature.h
M lib/feature.pm
M op.c
M op.h
M pod/perldelta.pod
M pp_ctl.c
M regen/feature.pl
M t/comp/require.t

  Log Message:
  ---
  Enable `use feature 'module_true'`

Per RFC 18, whenever `use feature 'module_true';` is enabled in a scope,
any file required with `require` has an implicit return value of true
and will not trigger the "did not return a true value" error condition.

This includes logic to use the OPf_SPECIAL flag for OP_RETURN listops to
indicate that the module_true feature is in effect when it executes.
This flag plays no role unless the OP_RETURN tail calls the pp_leaveeval
logic, so it doesn't affect normal sub returns.


  Commit: 1d9d7fed474ad56444213bbd88c4f549d0f4c6fe
  
https://github.com/Perl/perl5/commit/1d9d7fed474ad56444213bbd88c4f549d0f4c6fe
  Author: Yves Orton 
  Date:   2022-10-31 (Mon, 31 Oct 2022)

  Changed paths:
M pod/perlfunc.pod

  Log Message:
  ---
  perlfunc.pod - document module_true in the require entry

A brief note pointing people at the feature manpage.


  Commit: b9f7ec083eeaf9dc65062e96781a7c27fdb16fef
  
https://github.com/Perl/perl5/commit/b9f7ec083eeaf9dc65062e96781a7c27fdb16fef
  Author: Yves Orton 
  Date:   2022-10-31 (Mon, 31 Oct 2022)

  Changed paths:
M dump.c
M ext/Devel-Peek/t/Peek.t

  Log Message:
  ---
  dump.c - in op_dump show the hints and feature bits

I used to 'FEATS' instead of 'FEATURES' so the values line up
nicely.


  Commit: 3c2f267b7d429d07f246d2ca481635d2396c53f0
  
https://github.com/Perl/perl5/commit/3c2f267b7d429d07f246d2ca481635d2396c53f0
  Author: Yves Orton 
  Date:   2022-10-31 (Mon, 31 Oct 2022)

  Changed paths:
M op.c

  Log Message:
  ---
  op.c - remove superfluous whitespace


  Commit: 9a057471526ced50ee4d26b79afea682e11a6507
  
https://github.com/Perl/perl5/commit/9a057471526ced50ee4d26b79afea682e11a6507
  Author: Yves Orton 
  Date:   2022-10-31 (Mon, 31 Oct 2022)

  Changed paths:
M peep.c

  Log Message:
  ---
  peep.c - add a comment/question to a comment

We optimize away certain nextstate ops, but it isn't clear if
it is possible for the ops to be there to switch hints or feature
flags. Tony thinks its fine however. So I have added the commentary
to the comment for future readers.


Compare: https://github.com/Perl/perl5/compare/424b5b087db7...9a057471526c


[Perl/perl5] 6d6a7f: peep.c - add a comment/question to a comment

2022-10-31 Thread Yves Orton via perl5-changes
  Branch: refs/heads/yves/chr_rfc-18-module-true
  Home:   https://github.com/Perl/perl5
  Commit: 6d6a7f072965d0b444271ed202dbd1c32de6e171
  
https://github.com/Perl/perl5/commit/6d6a7f072965d0b444271ed202dbd1c32de6e171
  Author: Yves Orton 
  Date:   2022-10-31 (Mon, 31 Oct 2022)

  Changed paths:
M peep.c

  Log Message:
  ---
  peep.c - add a comment/question to a comment

We optimize away certain nextstate ops, but it isn't clear if
it is possible for the ops to be there to switch hints or feature
flags. Tony thinks its fine however. So I have added the commentary
to the comment for future readers.




[Perl/perl5] 845af2: fixup - dont use pointer until we check its good

2022-10-31 Thread Yves Orton via perl5-changes
  Branch: refs/heads/yves/cop_file_rcpv
  Home:   https://github.com/Perl/perl5
  Commit: 845af2499ba30088a0cd23abee9f0e3daf304f6c
  
https://github.com/Perl/perl5/commit/845af2499ba30088a0cd23abee9f0e3daf304f6c
  Author: Yves Orton 
  Date:   2022-10-31 (Mon, 31 Oct 2022)

  Changed paths:
M op.c

  Log Message:
  ---
  fixup - dont use pointer until we check its good


  Commit: 971ad5ccbbd86eaf9395a205ede171464d4ac462
  
https://github.com/Perl/perl5/commit/971ad5ccbbd86eaf9395a205ede171464d4ac462
  Author: Yves Orton 
  Date:   2022-10-31 (Mon, 31 Oct 2022)

  Changed paths:
M cop.h

  Log Message:
  ---
  fixup - use STRLEN for refcount instead of UV

This way it is 32 bit on a 32bit perl with 64bit integers.
Tony Cook requested this change.


Compare: https://github.com/Perl/perl5/compare/a9fcf3b360ca...971ad5ccbbd8


[Perl/perl5] 92306d: sv.c - fixup cast

2022-10-31 Thread Yves Orton via perl5-changes
  Branch: refs/heads/yves/cop_file_rcpv
  Home:   https://github.com/Perl/perl5
  Commit: 92306d7d4bb536aadbeb72d21ab518c136ea2f4f
  
https://github.com/Perl/perl5/commit/92306d7d4bb536aadbeb72d21ab518c136ea2f4f
  Author: Yves Orton 
  Date:   2022-10-31 (Mon, 31 Oct 2022)

  Changed paths:
M sv.c

  Log Message:
  ---
  sv.c - fixup cast




[Perl/perl5] 9a4a2b: scope_types.h - new header file for scope type data

2022-10-31 Thread Yves Orton via perl5-changes
  Branch: refs/heads/yves/cop_file_rcpv
  Home:   https://github.com/Perl/perl5
  Commit: 9a4a2b70930fa3347b39ba5c18dd064248d7c550
  
https://github.com/Perl/perl5/commit/9a4a2b70930fa3347b39ba5c18dd064248d7c550
  Author: Yves Orton 
  Date:   2022-10-31 (Mon, 31 Oct 2022)

  Changed paths:
M MANIFEST
M scope.c
M scope.h
A scope_types.h

  Log Message:
  ---
  scope_types.h - new header file for scope type data

Next patch this data will be autogenerated.


  Commit: c0bbcc5457fdb19639eff8b3add7c311d43a3875
  
https://github.com/Perl/perl5/commit/c0bbcc5457fdb19639eff8b3add7c311d43a3875
  Author: Yves Orton 
  Date:   2022-10-31 (Mon, 31 Oct 2022)

  Changed paths:
M MANIFEST
M regen.pl
A regen/scope_types.pl
M scope_types.h
M t/porting/regen.t

  Log Message:
  ---
  regen/scope_types.pl - add tool to manage the scope type defines

In scope.c and scope.h there are various defines that must be coordinated
with the contents of an array, and comments and ids which might have to be
mass changed manually in some circumstances. As this is error prone this
patch adds a new regen script to ensure it is kept in sync and to make the
process of adding new types trivial. The data that drives the script is
kept in the scripts __DATA__ section.


Compare: https://github.com/Perl/perl5/compare/92306d7d4bb5...c0bbcc5457fd


[Perl/perl5] 501a77: mg.c - fixup mangled indentation

2022-10-31 Thread Yves Orton via perl5-changes
  Branch: refs/heads/yves/cop_file_rcpv
  Home:   https://github.com/Perl/perl5
  Commit: 501a77e1e12bf0cbef690ab43aeb1c7a058d8aed
  
https://github.com/Perl/perl5/commit/501a77e1e12bf0cbef690ab43aeb1c7a058d8aed
  Author: Yves Orton 
  Date:   2022-10-31 (Mon, 31 Oct 2022)

  Changed paths:
M mg.c

  Log Message:
  ---
  mg.c - fixup mangled indentation

The code was almost unreadable as it was, with the indentation all
wonky. There only change visible under diff -w is removing an empty
line.


  Commit: fb6e6a396301b9c374a5e0db73c2cd55d649d28f
  
https://github.com/Perl/perl5/commit/fb6e6a396301b9c374a5e0db73c2cd55d649d28f
  Author: Yves Orton 
  Date:   2022-10-31 (Mon, 31 Oct 2022)

  Changed paths:
M scope.c

  Log Message:
  ---
  scope.c - whitespace fixup


  Commit: 4f36f1b8d1724c8d9e664233ed38f49c560ea8de
  
https://github.com/Perl/perl5/commit/4f36f1b8d1724c8d9e664233ed38f49c560ea8de
  Author: Yves Orton 
  Date:   2022-10-31 (Mon, 31 Oct 2022)

  Changed paths:
M cop.h
M op.c
M perl.c
M regen/warnings.pl
M util.c
M warnings.h

  Log Message:
  ---
  op.c - use refcounted pv pointers for cop_warnings

this allows multiple ops to share the same underlying
warning bit vector. the vectors are not deduped, however
they are efficiently copied and shared.


Compare: https://github.com/Perl/perl5/compare/c0bbcc5457fd...4f36f1b8d172


[Perl/perl5] 98f99b: cop.h - fixup - add comment to cop_warnings field

2022-10-31 Thread Yves Orton via perl5-changes
  Branch: refs/heads/yves/cop_file_rcpv
  Home:   https://github.com/Perl/perl5
  Commit: 98f99b9efadbaf26001339041c4af3f202324281
  
https://github.com/Perl/perl5/commit/98f99b9efadbaf26001339041c4af3f202324281
  Author: Yves Orton 
  Date:   2022-10-31 (Mon, 31 Oct 2022)

  Changed paths:
M cop.h

  Log Message:
  ---
  cop.h - fixup - add comment to cop_warnings field




[Perl/perl5] 73d66f: locale.c: Handle locale names with '@'

2022-10-31 Thread Karl Williamson via perl5-changes
  Branch: refs/heads/blead
  Home:   https://github.com/Perl/perl5
  Commit: 73d66f354cd4df0324b11e46af48f66bd5c1dd15
  
https://github.com/Perl/perl5/commit/73d66f354cd4df0324b11e46af48f66bd5c1dd15
  Author: Karl Williamson 
  Date:   2022-10-31 (Mon, 31 Oct 2022)

  Changed paths:
M locale.c

  Log Message:
  ---
  locale.c: Handle locale names with '@'

The XPG locale name standard says the codeset is the part of the name
after any dot, terminated by the end of string or an '@'.

Prior to this commit, the possibility of an '@' was not considered.




[Perl/perl5] cdee80: Add PERL_MAGIC_extvalue

2022-10-31 Thread Leon Timmermans via perl5-changes
  Branch: refs/heads/leont/value_magic
  Home:   https://github.com/Perl/perl5
  Commit: cdee8083a99ddaa290a0a9184e4327ba5c69d0b8
  
https://github.com/Perl/perl5/commit/cdee8083a99ddaa290a0a9184e4327ba5c69d0b8
  Author: Leon Timmermans 
  Date:   2022-10-31 (Mon, 31 Oct 2022)

  Changed paths:
M mg_names.inc
M mg_raw.h
M mg_vtable.h
M pod/perldelta.pod
M pod/perlguts.pod
M regen/mg_vtable.pl

  Log Message:
  ---
  Add PERL_MAGIC_extvalue

A new magic type PERL_MAGIC_extvalue has been added. This is available
for use like PERL_MAGIC_ext, but is a value magic: upon localization the
new value will not be magical.


  Commit: 1159199ebad359ee0f26ffa3db04e0064a76e1fb
  
https://github.com/Perl/perl5/commit/1159199ebad359ee0f26ffa3db04e0064a76e1fb
  Author: Leon Timmermans 
  Date:   2022-10-31 (Mon, 31 Oct 2022)

  Changed paths:
M ext/XS-APItest/APItest.pm
M ext/XS-APItest/APItest.xs
M ext/XS-APItest/t/magic.t

  Log Message:
  ---
  Simplify magic test


  Commit: e10d2a6bc9fabd46ae6c7ef75bc518d9fcd24182
  
https://github.com/Perl/perl5/commit/e10d2a6bc9fabd46ae6c7ef75bc518d9fcd24182
  Author: Leon Timmermans 
  Date:   2022-10-31 (Mon, 31 Oct 2022)

  Changed paths:
M ext/XS-APItest/t/magic.t

  Log Message:
  ---
  Test localization of ext magic


  Commit: c5e21ebfd9e7ad8ab220cbb82fe855d9e447c366
  
https://github.com/Perl/perl5/commit/c5e21ebfd9e7ad8ab220cbb82fe855d9e447c366
  Author: Leon Timmermans 
  Date:   2022-10-31 (Mon, 31 Oct 2022)

  Changed paths:
M ext/XS-APItest/APItest.xs
M ext/XS-APItest/t/magic.t

  Log Message:
  ---
  Add tests for value magic


Compare: https://github.com/Perl/perl5/compare/d8fbe8c12300...c5e21ebfd9e7


[Perl/perl5] 9d6c2e: WIP

2022-10-31 Thread Yves Orton via perl5-changes
  Branch: refs/heads/yves/cop_file_rcpv
  Home:   https://github.com/Perl/perl5
  Commit: 9d6c2e420a57334c58b93a41bf85ca992b7f3a5a
  
https://github.com/Perl/perl5/commit/9d6c2e420a57334c58b93a41bf85ca992b7f3a5a
  Author: Yves Orton 
  Date:   2022-10-31 (Mon, 31 Oct 2022)

  Changed paths:
M perl.c

  Log Message:
  ---
  WIP


  Commit: 9a750531ef790372885036c0c50d6223dbd15200
  
https://github.com/Perl/perl5/commit/9a750531ef790372885036c0c50d6223dbd15200
  Author: Yves Orton 
  Date:   2022-10-31 (Mon, 31 Oct 2022)

  Changed paths:
M gv.c

  Log Message:
  ---
  gv.c - fixup for cop_file logic.

make sure we arrange to free everything properly
when we construct a warning.


  Commit: dcec25c1d9306cdfd3afa55cc7ee8ef7df9e1778
  
https://github.com/Perl/perl5/commit/dcec25c1d9306cdfd3afa55cc7ee8ef7df9e1778
  Author: Yves Orton 
  Date:   2022-10-31 (Mon, 31 Oct 2022)

  Changed paths:
M mg.c

  Log Message:
  ---
  mg.c - make sure we dont leak warnings data


Compare: https://github.com/Perl/perl5/compare/98f99b9efadb...dcec25c1d930


[Perl/perl5] ef28ba: locale.c - add comments about PERL_DESTRUCT_LEVEL ...

2022-10-31 Thread Yves Orton via perl5-changes
  Branch: refs/heads/yves/locale_destruct_comment
  Home:   https://github.com/Perl/perl5
  Commit: ef28bacbb82cdc0777409dd6e058cb37e3edad67
  
https://github.com/Perl/perl5/commit/ef28bacbb82cdc0777409dd6e058cb37e3edad67
  Author: Yves Orton 
  Date:   2022-10-31 (Mon, 31 Oct 2022)

  Changed paths:
M locale.c

  Log Message:
  ---
  locale.c - add comments about PERL_DESTRUCT_LEVEL avoiding "leaks"

Some of the locale data is deliberately not destroyed during shutdown.
Setting PERL_DESTRUCT_LEVEL=2 causes them to be cleaned up. If someone
ends up debugging under the address sanitizer and ends up at this logic
then the comments will help them avoid some frustration.




[Perl/perl5] 5e5258: mg.c/perl.c/scope.c - fixup mangled indentation an...

2022-10-31 Thread Yves Orton via perl5-changes
  Branch: refs/heads/yves/cop_file_rcpv
  Home:   https://github.com/Perl/perl5
  Commit: 5e525861cc5236784775bd61ef663a8f61d0f7da
  
https://github.com/Perl/perl5/commit/5e525861cc5236784775bd61ef663a8f61d0f7da
  Author: Yves Orton 
  Date:   2022-10-31 (Mon, 31 Oct 2022)

  Changed paths:
M mg.c
M perl.c
M scope.c

  Log Message:
  ---
  mg.c/perl.c/scope.c - fixup mangled indentation and whitespace

Various code related to set_and_free_cop_warnings was terribly mangled
as far as whitespace goes. This patch cleans it up so it is readable and
correctly indented. Whitespace only changes.


  Commit: 641f4095897436ca237e66fe718e40a315bdc85d
  
https://github.com/Perl/perl5/commit/641f4095897436ca237e66fe718e40a315bdc85d
  Author: Yves Orton 
  Date:   2022-10-31 (Mon, 31 Oct 2022)

  Changed paths:
M cop.h
M embed.fnc
M embed.h
M ext/B/B.pm
M ext/B/B.xs
M gv.c
M op.c
M op.h
M perl.c
M proto.h
M scope.c
M scope.h
M sv.c

  Log Message:
  ---
  cop.h - add support for refcounted filenames in cops under threads

We have a weird bifurcation of the cop logic around threads. With
threads we use a char * cop_file member, without it we use a GV * and
replace cop_file with cop_filegv.

The GV * code refcounts filenames and more or less efficiently shares
the filename amongst many opcodes. However under threads we were
simplify copying the filenames into each opcode. This is because in
theory opcodes created in one thread can be destroyed in another. I say
in theory because as far as I know the core code does not actually do
this. But we have tests that you can construct a perl, clone it, and
then destroy the original, and have the copy work just fine, this means
that opcodes constructed in the main thread will be destroyed in the
cloned thread. This in turn means that you can't put SV derived
structures into the op-tree under threads. Which is why we can not use
the GV * stategy under threads.

As such this code adds a new struct/type RCPV, which is a refcounted
string using shared memory. This is implemented in such a way that code
that previously used a char * can continue to do so, as the refcounting
data is located a specific offset before the char * pointer itself.
This also allows the len data to embedded "into" the PV, which allows
us to expose macros to acces the length of what is in theory a null
terminated string.

struct rcpv {
UV  refcount;
STRLEN  len;
charpv[1];
};
typedef struct rcpv RCPV;

The struct is sized appropriately on creation in rcpv_new() so that the
pv member contains the full string plus a null byte. It then returns a
pointer to the pv member of the struct. Thus the refcount and length and
embedded at a predictable offset in front of the char *, which means we
do not have to change any types for members using this.

We provide three operations: rcpv_new(), rcpv_copy() and rcpv_free(),
which roughly correspond with newSVpv(), SvREFCNT_inc(), SvREFCNT_dec(),
and a handful of macros as well. We also expose SAVERCPVFREE which is
similar to SAVEGENERICSV but operates on pv's constructed with
rcpv_new().

Currently I have not restricted use of this logic to threaded perls. We
simply do not use it in unthreaded perls, but I see no reason we
couldn't normalize the code to use this in both cases, except possibly
that actually the GV case is more efficient.

Note that rcpv_new() does NOT use a hash table to dedup strings. Two
calls to rcpv_new() with the same arguments will produce two distinct
pointers with their own refcount data.

Refcounting the cop_file data was Tony Cook's idea.


  Commit: f9b15ffeb432f3cfa2ffd516ed1d749a848802f5
  
https://github.com/Perl/perl5/commit/f9b15ffeb432f3cfa2ffd516ed1d749a848802f5
  Author: Yves Orton 
  Date:   2022-10-31 (Mon, 31 Oct 2022)

  Changed paths:
M MANIFEST
M scope.c
M scope.h
A scope_types.h

  Log Message:
  ---
  scope_types.h - new header file for scope type data

Next patch this data will be autogenerated.


  Commit: 81e3ee303dbc9a8d4e74b0cb304892c3b564472c
  
https://github.com/Perl/perl5/commit/81e3ee303dbc9a8d4e74b0cb304892c3b564472c
  Author: Yves Orton 
  Date:   2022-10-31 (Mon, 31 Oct 2022)

  Changed paths:
M MANIFEST
M regen.pl
A regen/scope_types.pl
M scope_types.h
M t/porting/regen.t

  Log Message:
  ---
  regen/scope_types.pl - add tool to manage the scope type defines

In scope.c and scope.h there are various defines that must be coordinated
with the contents of an array, and comments and ids which might have to be
mass changed manually in some circumstances. As this is error prone this
patch adds a new regen script to ensure it is kept in sync and to make the
process of adding new types trivial. The data that drives the script is
kept in the scripts __DATA__ section.


  Commit: 54cd5602dea857949608f9956577b4bbbe0842d7
  
https://github.

[Perl/perl5] 86c1ae: Test localization of ext magic

2022-10-31 Thread Leon Timmermans via perl5-changes
  Branch: refs/heads/leont/value_magic
  Home:   https://github.com/Perl/perl5
  Commit: 86c1ae95fc71198ae137c02b3b7f37f9540aa0cc
  
https://github.com/Perl/perl5/commit/86c1ae95fc71198ae137c02b3b7f37f9540aa0cc
  Author: Leon Timmermans 
  Date:   2022-10-31 (Mon, 31 Oct 2022)

  Changed paths:
M ext/XS-APItest/t/magic.t

  Log Message:
  ---
  Test localization of ext magic


  Commit: 4c55365f89e9a8e0c82d1c82d596a41fb2e62496
  
https://github.com/Perl/perl5/commit/4c55365f89e9a8e0c82d1c82d596a41fb2e62496
  Author: Leon Timmermans 
  Date:   2022-10-31 (Mon, 31 Oct 2022)

  Changed paths:
M ext/XS-APItest/APItest.xs
M ext/XS-APItest/t/magic.t

  Log Message:
  ---
  Add tests for value magic


Compare: https://github.com/Perl/perl5/compare/c5e21ebfd9e7...4c55365f89e9


[Perl/perl5] 0e4116: Devel-PPPort: fix STMT_START and STMT_END to not w...

2022-10-31 Thread Graham Knop via perl5-changes
  Branch: refs/heads/haarg/ppport-no-compound-token-split-by-macro-warnings
  Home:   https://github.com/Perl/perl5
  Commit: 0e41162d17fedf4d9e36b2eb1a44894a790da4b0
  
https://github.com/Perl/perl5/commit/0e41162d17fedf4d9e36b2eb1a44894a790da4b0
  Author: Graham Knop 
  Date:   2022-11-01 (Tue, 01 Nov 2022)

  Changed paths:
M dist/Devel-PPPort/parts/inc/misc

  Log Message:
  ---
  Devel-PPPort: fix STMT_START and STMT_END to not warn on clang

Since 7169efc77525df70484a824bff4ceebd1fafc760, perl's core STMT_START
and STMT_END macros no longer try to use brace groups, due to the
warnings they can generate and their very limited usefulness.

Update Devel::PPPort to always just redefine the macros to the new
simple non-warning versions.