This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perl5.git
2 years agoFix misspellings in documentation. Correct spelling of name to 'De
Ivan Panchenko [Sat, 25 Dec 2021 23:14:58 +0000 (00:14 +0100)]
Fix misspellings in documentation. Correct spelling of name to 'De
Morgan'.

Committer: Ivan Panchenko is now a Perl author

For: https://github.com/Perl/perl5/pull/19298

2 years agoDocument and test command-line switch '-?'
James E Keenan [Fri, 12 Nov 2021 23:55:04 +0000 (23:55 +0000)]
Document and test command-line switch '-?'

2 years agoReplace 'slave' with 'client'
James E Keenan [Thu, 3 Jun 2021 12:22:16 +0000 (12:22 +0000)]
Replace 'slave' with 'client'

This commit moves us a step forward on eliminating 'master/slave' terminology.

Its scope is limited to those files within the Perl 5 core distribution which
are not CPAN-upstream.  Within that scope, we leave untouched the use of the
term 'slave' in epigraphs and other literary quotations and its use in data
coming from outside sources (e.g., Unicode code points).

Increment $VERSION in lib/perl5db.pl.  Revisions per rjbs feedback.

For: https://github.com/Perl/perl5/pull/19227

2 years agosv_upgrade: c99 compound literals to initialize xpvav/xpvhv
Richard Leach [Thu, 9 Dec 2021 22:38:51 +0000 (22:38 +0000)]
sv_upgrade: c99 compound literals to initialize xpvav/xpvhv

For both the AV and HV cases, the new body is Zero()ed but then various
struct members are set to non-zero values. Now that we support parts of
c99, it seems more efficient to use compound literals to initailize the
struct members.

With gcc v8.3.0, the compiled function is smaller by 25 instructions.
sv.o is slightly smaller, but the final perl binary size is unchanged.

2 years agosv_upgrade: remove redundant AvALLOC(sv) = 0
Richard Leach [Thu, 9 Dec 2021 22:25:38 +0000 (22:25 +0000)]
sv_upgrade: remove redundant AvALLOC(sv) = 0

xav_alloc is a member of the xpvav struct. The instance modified
here would have been Zero()ed several lines previously, so both
sides of this if() branch should be no-ops.

With gcc 8.3.0 the compiled function is about 6 instructions smaller.

2 years agouse is_deeply instead of eq_ Test::More functions
Michiel Beijen [Sat, 18 Dec 2021 11:10:15 +0000 (12:10 +0100)]
use is_deeply instead of eq_ Test::More functions

the eq_set, eq_hash, and eq_array functions in Test::More are
discouraged to use, and is_deeply is recommended. Ref:

https://metacpan.org/pod/Test::More#Discouraged-comparison-functions

The reason for this is that, if the tests fail, is_deeply has much
better diagnostics.

The other thing is that is_deeply is a test function directly, where
eq_hash and such need to be wrapped inside ok(). This is easy to forget
-- proof of this is in Benchmark.t, where we had this code, that did not
test anything:

    eq_set([keys %$got], [qw(Foo Bar Baz)], 'should be exactly three objects');

It is now replaced by:

    is_deeply([sort keys %$got], [sort qw(Foo Bar Baz)], 'should be exactly three objects');

this commit replaces all usage of eq_set, eq_hash, and eq_array in lib/
and ext/ for tests that use Test::More.

One small exception is where a negated test is used; Test::More does not
have is_not_deeply() or such. Test2 has `isnt()` for this, but that is
not in core. In those cases, we still keep using the eq_ operators.

2 years agoAdd last-resort implementation for POSIX::FLT_ROUNDS.
TAKAI Kousuke [Tue, 14 Dec 2021 09:33:55 +0000 (18:33 +0900)]
Add last-resort implementation for POSIX::FLT_ROUNDS.

POSIX::FLT_ROUNDS now emulates (more) standard behavior that
reflects the current rounding mode set by fesetround(),
even when compiled with GCC whose FLT_ROUNDS is wrongly fixed to 1.

Also add tests for this.

2 years agoPOSIX: FLT_ROUNDS is now an XS function rather than a constant
TAKAI Kousuke [Wed, 20 Jan 2021 11:58:22 +0000 (20:58 +0900)]
POSIX: FLT_ROUNDS is now an XS function rather than a constant

POSIX::FLT_ROUNDS used to be an NV constant, but C FLT_ROUNDS is
actually an integer and not a constant (C99 seems to say that
it reflects the current rounding mode set by fesetround()).

2 years agoBump version number of ext/POSIX
Karl Williamson [Fri, 24 Dec 2021 15:20:22 +0000 (08:20 -0700)]
Bump version number of ext/POSIX

2 years agoAdd option '-?' as a synonym to -h
Karl Williamson [Thu, 30 Sep 2021 15:56:55 +0000 (09:56 -0600)]
Add option '-?' as a synonym to -h

-? is a common paradigm for finding the usage of a program.  Prior to
this commit, doing so on perl would tell you it is illegal and suggest
-h.  This commit allows someone using this paradigm  to skip the second
step

2 years agoData-Dumper: Fixes for EBCDIC
Karl Williamson [Sat, 3 Jul 2021 23:49:12 +0000 (17:49 -0600)]
Data-Dumper: Fixes for EBCDIC

This changes to properly calculate the control characters on EBCDIC
systems.  There should be no change to ASCII doe.

Comments are updated and corrected to properly describe the EBCDIC
situation.

The tests change to use the character \xB6, as that means the same in
both character sets, and so works on both without special casing.

2 years agoBumped Module-CoreList ready for 5.35.8
Neil Bowers [Tue, 21 Dec 2021 01:41:24 +0000 (01:41 +0000)]
Bumped Module-CoreList ready for 5.35.8

2 years agoBump the perl version in various places for 5.35.8
Neil Bowers [Tue, 21 Dec 2021 01:17:04 +0000 (01:17 +0000)]
Bump the perl version in various places for 5.35.8

2 years agonew perldelta for 5.35.8
Neil Bowers [Tue, 21 Dec 2021 00:44:56 +0000 (00:44 +0000)]
new perldelta for 5.35.8

2 years agorecorded 5.35.7 release as done in the release schedule
Neil Bowers [Tue, 21 Dec 2021 00:27:15 +0000 (00:27 +0000)]
recorded 5.35.7 release as done in the release schedule

2 years agoRecorded epigraph for 5.35.7
Neil Bowers [Tue, 21 Dec 2021 00:25:55 +0000 (00:25 +0000)]
Recorded epigraph for 5.35.7

2 years agoMerge branch 'release-5.35.7' into blead
Neil Bowers [Tue, 21 Dec 2021 00:20:05 +0000 (00:20 +0000)]
Merge branch 'release-5.35.7' into blead

2 years agoAdded 5.35.7 to perlhist v5.35.7
Neil Bowers [Mon, 20 Dec 2021 21:46:33 +0000 (21:46 +0000)]
Added 5.35.7 to perlhist

2 years agoUpdated perldelta with changes to core modules
Neil Bowers [Mon, 20 Dec 2021 21:42:04 +0000 (21:42 +0000)]
Updated perldelta with changes to core modules

2 years agoUpdate Module::CoreList for 5.35.7
Neil Bowers [Mon, 20 Dec 2021 21:06:21 +0000 (21:06 +0000)]
Update Module::CoreList for 5.35.7

2 years agoadded some entries to perldelta after trawling the git log
Neil Bowers [Mon, 20 Dec 2021 19:03:35 +0000 (19:03 +0000)]
added some entries to perldelta after trawling the git log

2 years agoUpdated dual-life modules for 5.35.7
Neil Bowers [Mon, 20 Dec 2021 17:03:10 +0000 (17:03 +0000)]
Updated dual-life modules for 5.35.7

2 years agoperldelta entry for the fix for unbounded memory consumption for hashes
Nicholas Clark [Mon, 20 Dec 2021 16:19:54 +0000 (16:19 +0000)]
perldelta entry for the fix for unbounded memory consumption for hashes

This is a fix for a bug introduced two months ago in v5.35.5.

2 years agoMention builtin in perldelta
Paul "LeoNerd" Evans [Sat, 18 Dec 2021 22:52:06 +0000 (22:52 +0000)]
Mention builtin in perldelta

2 years agoDocument that all of builtin is currently experimental
Paul "LeoNerd" Evans [Sat, 18 Dec 2021 21:39:14 +0000 (21:39 +0000)]
Document that all of builtin is currently experimental

2 years agodist/IO/IO.xs: Rmv defns that ppport.h supplies
Karl Williamson [Thu, 17 Jun 2021 03:03:42 +0000 (21:03 -0600)]
dist/IO/IO.xs: Rmv defns that ppport.h supplies

No sense trying to derive them ourselves.

2 years agoNo need to Renew() HvARRAY() to the same size in S_hv_auxinit()
Nicholas Clark [Wed, 10 Nov 2021 10:57:34 +0000 (10:57 +0000)]
No need to Renew() HvARRAY() to the same size in S_hv_auxinit()

Fix a thinko/missed simplification that should have been part of
commit 53a41f9c2c0671d8:
    Inline the xhv_aux struct in the main hash body

    For now, memory for this structure is always allocated, even though it
    isn't always flagged as being present.

Prior to that commit the Renew() in S_hv_auxinit() had been needed because
the memory that HvARRAY() points to needed to be expanded from "just the
array of HE pointers" to "that, plus space for the xhv_aux struct.

With that commit, the xhv_aux struct was no longer stored in the same
memory block, so there was no need to reallocate storage. Hence the
Renew() should be completely removed. What that commit actually did was
neatly change the parameters to the Renew() call such that it reallocated
storage to the exact same size, which isn't wrong, but is makework. Oops.

2 years agoReturn the "hv with aux" PVHV bodies to the correct arena
Nicholas Clark [Tue, 9 Nov 2021 09:24:06 +0000 (09:24 +0000)]
Return the "hv with aux" PVHV bodies to the correct arena

Move the assignments to SvFLAGS(sv) after the check for SvOOK(), and use
arena_index for the array index to PL_body_roots. Without both fixes,
del_body() would always be called with &PL_body_roots[SVt_PVHV], which is
wrong if the body was allocated from &PL_body_roots[HVAUX_ARENA_ROOT_IX].

PVHV body handling was changed recently by commit 94ee6ed79dbca73d:
    Split the XPVHV body into two variants "normal" and "with aux"

    Default to the smaller body, and switch to the larger body if we need to
    allocate a C<struct xpvhv_aux> (eg need an iterator).

    This restores the previous small size optimisation for hashes used as
    objects.

as part of changing where memory for C<struct xpvhv_aux> is allocated.

The new implementation uses two sizes of "bodies" for PVHVs - the default
body is unchanged, but when a hash needs a C<struct xpvhv_aux>, it now
swaps out the default body for a larger body with space for the struct.

(Previously it would reallocate the memory used for HvARRAY() to make space
for the struct there - an approach which requires more tracking of changed
pointers.)

That commit was subtly buggy in that on hash deallocation it didn't *return*
hash bodies to the correct arena. As-was, it would return both sizes of hash
body to the arena for the default (smaller) body. This was due to a
combination of two subtle bugs

1) the explicit reset of all SvFLAGS to SVf_BREAK would implicitly clear
   SVf_OOK. That flag bit set is needed to signal the different body size
2) The code must call del_body() with &PL_body_roots[arena_index], not
   &PL_body_roots[type]
   type is SVt_PVHV for both body sizes. arena_index is SVt_PVHV for the
   smaller (default) bodies, and HVAUX_ARENA_ROOT_IX for the larger bodies.

There were no memory errors or leaks (that would have been detectable by
tools such as ASAN or valgrind), but the bug meant that larger hash bodies
would never get re-used. So for code that was steady-state creating and
destroying hashes with iterators (or similar), instead of those bodies being
recycled via their correct arena, the interpreter would need to continuously
allocate new memory for that arena, whilst accumulating ever more unused
"smaller" bodies in the other arena.

I didn't spot this bug whilst reviewing commit 8461dd8ad90b2bce:
    don't overwrite the faked up type details for hv-with-aux

    CID 340472

which is in the same area of the code, but fixes a related problem.

Curiously when reporting CID 340738:

    Assigning value "SVt_IV" to "arena_index" here, but that stored value is
    overwritten before it can be used

Coverity also didn't spot that the code in question was unconditionally
unreachable, and warn about that, or modify its warning to note that.

(For the code prior to this commit SvOOK(sv) at that point could only ever
be false. This is obscured thanks to macros, but all these macros are
unconditionally defined to the same values, so static analysis should be
able to infer that they are actually constant, and reason accordingly.
To be fair, this is *hard*. But not impossible. Hence I infer that static
analysis tools still have room for improvement, and can make "mistakes".)

Ironically, defining PURIFY would hide this bug, because that disables the
use of arenas, instead allocating all bodies explicitly with malloc() and
releasing them with free(), and free() doesn't need to know the size of the
memory block, hence it wouldn't matter that the code had that size wrong.

2 years agoDon't clear the flag bit SVf_OOK in hv_undef_flags()
Nicholas Clark [Wed, 10 Nov 2021 10:29:13 +0000 (10:29 +0000)]
Don't clear the flag bit SVf_OOK in hv_undef_flags()

Now that HvAUX(hv) is allocated as part of the HV's body, it's imperative
to retain the flag that indicates which size of body has been allocated.

Otherwise, if we clear the flag, sv_clear() believes that the body is the
smaller of the two possible sizes, and so returns it to the correct arena
for that body size. This doesn't result in out-of-bounds memory reads, or
even memory leaks (when full cleanup runs with PERL_DESTRUCT_LEVEL=2),
because all bodies are still correctly tracked. However, without this bug
fixed, code that takes the same hash and repeatedly

1) assigns entries
2) iterates the hash
3) undef %hash

will request one new (larger) hash body for each iteration of the loop,
but each time return it to the arena for the smaller hash bodies, with the
result that the interpreter will steadily request ever more memory for
arenas for larger hash bodies, until memory is exhausted.

2 years agoDocument the HV aux struct free/release logic in hv_undef_flags()
Nicholas Clark [Thu, 18 Nov 2021 08:44:45 +0000 (08:44 +0000)]
Document the HV aux struct free/release logic in hv_undef_flags()

struct xpvhv_aux holds 4 pointers which can point to memory which needs
explicit release - document how hv_undef_flags() is directly responsible
for freeing xhv_mro_meta, indirectly responsible for freeing xhv_eiter,
and by implication can't free xhv_backreference or xhv_name_u.

2 years agoutf8.c: Rmv duplicate #define.
Karl Williamson [Sat, 18 Dec 2021 14:13:25 +0000 (07:13 -0700)]
utf8.c: Rmv duplicate #define.

This code is identical to a few lines above it

2 years agoUpdate ExtUtils-MakeMaker to CPAN version 7.64
Chris 'BinGOs' Williams [Sat, 18 Dec 2021 12:44:39 +0000 (12:44 +0000)]
Update ExtUtils-MakeMaker to CPAN version 7.64

  [DELTA]

7.64  Fri 17 Dec 15:35:46 GMT 2021

    No changes since v7.63_11

7.63_11 Tue 14 Dec 16:00:11 GMT 2021

    OS390 fixes:
    - Extend prereqs sort to work on EBCDIC

7.63_10 Mon 13 Dec 16:26:49 GMT 2021

    OS390 fixes:
    - Fix dynamic loading

7.63_09 Wed  8 Dec 22:20:53 GMT 2021

    Enhancements:
    - Don't use canned libpth values

7.63_08 Sat 27 Nov 17:28:03 GMT 2021

    Correction:
    - Previous change to ${LDFLAGS) was reverted

7.63_07 Sat 27 Nov 11:34:12 GMT 2021

    Enhancements:
    - Add $(LDFLAGS) when linking binary modules

7.63_06 Wed  3 Nov 01:24:05 GMT 2021

    Bug fixes:
    - Add -rpath when compiling XS modules on macOS

7.63_05 Sat 14 Aug 09:04:08 BST 2021

    Enhancements:
    - Added CPPRUN variable

7.63_04 Wed 30 Jun 15:15:01 BST 2021

    Doc fixes:
    - Describe CCFLAGS’ default

7.63_03 Tue 22 Jun 14:39:32 BST 2021

    OS390 Enhancements:
    - Fix override xs_make_dynamic_lib() for os390

7.63_02 Thu  3 Jun 19:52:03 BST 2021

    Doc fixes:
    - Changed wording for POLLUTE

7.63_01 Tue 25 May 16:22:50 BST 2021

    Bug fixes:
    - Comparing inodes numerically is unsafe

2 years agofix struct ioinfo definition for Mingw
Tomasz Konojacki [Thu, 16 Dec 2021 20:15:56 +0000 (21:15 +0100)]
fix struct ioinfo definition for Mingw

The "#ifndef _SAFECRT_IMPL" part made sense only for no longer
supported versions of Visual C++, but
92ca2349051b948d915e3fc721e3cbb97e7271e2 has accidentally exposed it
to Mingw builds.

2 years agoMark keywords.{c,h} as linguist-generated in .gitattributes
Paul "LeoNerd" Evans [Thu, 16 Dec 2021 18:21:09 +0000 (18:21 +0000)]
Mark keywords.{c,h} as linguist-generated in .gitattributes

2 years agoperlapio: binmode() and apply_layers() require pTHX
Karl Williamson [Thu, 29 Jul 2021 14:48:12 +0000 (08:48 -0600)]
perlapio: binmode() and apply_layers() require pTHX

These two functions, unlike all the rest,  require the thread context
parameter to be explicitly passed.  This commit makes the  documentation
be accurate.

2 years ago_MSC_VER is now always >= 1800 (i.e. Visual C++ 2013, aka Visual C++ 12.0)
Steve Hay [Fri, 5 Nov 2021 09:38:42 +0000 (09:38 +0000)]
_MSC_VER is now always >= 1800 (i.e. Visual C++ 2013, aka Visual C++ 12.0)

2 years agoMinor RMG tweaks
Richard Leach [Mon, 22 Nov 2021 20:46:41 +0000 (20:46 +0000)]
Minor RMG tweaks

2 years agoMinor output tweaks to sync-with-cpan
Richard Leach [Mon, 22 Nov 2021 21:14:56 +0000 (21:14 +0000)]
Minor output tweaks to sync-with-cpan

2 years agoAlso fix paren-less calls of subs where a filehandle could be
Dagfinn Ilmari Mannsåker [Sat, 11 Dec 2021 13:14:27 +0000 (13:14 +0000)]
Also fix paren-less calls of subs where a filehandle could be

If a sub exists, it takes precedence over the filehandle
interpretation even without the parens:

    $ perl  -le 'sub foo { "bar" } print foo;'
    bar

2 years agoFix function calls being misinterpreted as bareword filehandles
Dagfinn Ilmari Mannsåker [Fri, 10 Dec 2021 23:57:14 +0000 (23:57 +0000)]
Fix function calls being misinterpreted as bareword filehandles

When bareword filehandles are disabled, the parser was interpreting
any bareword as a filehandle, even when immediatey followed by parens:

    $ perl -M-feature=bareword_filehandles -le 'print foo()'
    Bareword filehandle "foo" not allowed under 'no feature "bareword_filehandles"' at -e line 1.

While with the feature enabled, it works and prints the value returned
by the function:

    $ perl  -le 'sub foo { @_ } print foo("bar")'
    bar

As for filehandles versus functions, a space before the parens makes
the difference:

    $ perl -le 'print STDOUT ("bar")'
    bar
    $ perl -le 'print STDOUT("bar")'
    Undefined subroutine &main::STDOUT called at -e line 1.

This fixes the bug by using the already-existing "immediate_paren"
variable to make it consistent when the feature is disabled.

Fixes #19271

2 years agoModernise File::Compare a little
James Raspass [Sun, 5 Dec 2021 21:12:47 +0000 (21:12 +0000)]
Modernise File::Compare a little

 - Move the version to the package line and bump it.
 - Bump use version now that we're using package NAME VER.
 - Drop strict now that we get it from use version.
 - Switch to non-inheritance based Exporter usage.
 - Use defined-or operator.

2 years agoperltie: Fix variable name in TIEHASH example
Jakub Wilk [Mon, 13 Dec 2021 15:04:52 +0000 (16:04 +0100)]
perltie: Fix variable name in TIEHASH example

2 years agoMerge branch 'builtin-in-core-libs' into blead
Paul "LeoNerd" Evans [Tue, 14 Dec 2021 22:33:34 +0000 (22:33 +0000)]
Merge branch 'builtin-in-core-libs' into blead

2 years agot/op/switch.t no longer needs to avoid overload.pm on miniperl 19269/head
Paul "LeoNerd" Evans [Fri, 10 Dec 2021 15:51:37 +0000 (15:51 +0000)]
t/op/switch.t no longer needs to avoid overload.pm on miniperl

2 years agoFix indirect call of ->import
Paul "LeoNerd" Evans [Thu, 9 Dec 2021 18:36:53 +0000 (18:36 +0000)]
Fix indirect call of ->import

2 years agoNo need for avoiding overload in File::Copy
Paul "LeoNerd" Evans [Wed, 8 Dec 2021 13:17:27 +0000 (13:17 +0000)]
No need for avoiding overload in File::Copy

2 years agoUse builtin::blessed() in overload.pm rather than using Scalar::Util
Paul "LeoNerd" Evans [Wed, 8 Dec 2021 11:42:47 +0000 (11:42 +0000)]
Use builtin::blessed() in overload.pm rather than using Scalar::Util

2 years agoUse builtin::reftype in ext/
Paul "LeoNerd" Evans [Thu, 9 Dec 2021 18:03:09 +0000 (18:03 +0000)]
Use builtin::reftype in ext/

2 years agoPorting/makerel: Don't reinvent a function
Karl Williamson [Tue, 14 Dec 2021 16:50:37 +0000 (09:50 -0700)]
Porting/makerel: Don't reinvent a function

It turns out the functionality here duplicates a pre-existing tool,
which this commit converts to use instead.

2 years agoPorting/makrel: White space only
Karl Williamson [Tue, 14 Dec 2021 16:53:31 +0000 (09:53 -0700)]
Porting/makrel: White space only

2 years agoPorting/makerel: Add xlation of UTF-16 files
Karl Williamson [Mon, 5 Jul 2021 07:31:06 +0000 (01:31 -0600)]
Porting/makerel: Add xlation of UTF-16 files

2 years agoPorting/makerel: Avoid hardcoding UTF-EBCDICS
Karl Williamson [Mon, 5 Jul 2021 07:21:26 +0000 (01:21 -0600)]
Porting/makerel: Avoid hardcoding UTF-EBCDICS

Instead, this uses the fundamental constants and derived values copied
from utf8.h, making things shorter

2 years agoPorting/makerel: White-space/comment only
Karl Williamson [Mon, 5 Jul 2021 07:15:53 +0000 (01:15 -0600)]
Porting/makerel: White-space/comment only

Prepare for a future commit that will add a surrounding block.

2 years agoPorting/makerel: Add use strict/warnings
Karl Williamson [Mon, 5 Jul 2021 06:53:02 +0000 (00:53 -0600)]
Porting/makerel: Add use strict/warnings

2 years agoPorting/makerel Make EBCDIC files writable
Karl Williamson [Fri, 2 Jul 2021 15:33:47 +0000 (09:33 -0600)]
Porting/makerel Make EBCDIC files writable

Some of them need to be changed after generation

2 years agot/TEST: white space only
Karl Williamson [Tue, 14 Dec 2021 15:11:20 +0000 (08:11 -0700)]
t/TEST: white space only

2 years agot/TEST: print Skip msg for EBCDIC skipped tests
Karl Williamson [Tue, 14 Dec 2021 15:06:53 +0000 (08:06 -0700)]
t/TEST: print Skip msg for EBCDIC skipped tests

2 years agomktables: Use builtin::refaddr
Karl Williamson [Sat, 11 Dec 2021 20:32:49 +0000 (13:32 -0700)]
mktables: Use builtin::refaddr

Now that this function is available in miniperl, mktables can use it to
avoid a bunch of visually distracting 'no overloading' calls.

2 years agomktables: Don't calculate some unused values
Karl Williamson [Sat, 11 Dec 2021 20:07:05 +0000 (13:07 -0700)]
mktables: Don't calculate some unused values

These apparently were once needed, but no longer.

2 years agoUpdate compile and bind options for z/OS (os390)
Mike Fulton [Wed, 8 Dec 2021 01:06:02 +0000 (19:06 -0600)]
Update compile and bind options for z/OS (os390)

This update enables us to build EBCDIC static/dynamic
and 31-bit/64-bit addressing mode Perl. The number of
tests that pass is consistent with the baseline before
these updates, namely:

For blead.31.dynamic.ebcdic
  Configured using -Dusedl

  Failed 98 tests out of 1939, 94.95% okay.
  Elapsed: 1038 sec
  u=18.13  s=6.04  cu=535.69  cs=178.56  scripts=1939  tests=1035071

For blead.64.dynamic.ebcdic
  Configured using -Dusedl -Duse64bitall

  Failed 102 tests out of 1941, 94.74% okay.
  Elapsed: 1057 sec
  u=19.49  s=6.49  cu=543.00  cs=181.00  scripts=1941  tests=1053149

These changes also provide the base support to be able to provide
ASCII static/dynamic and 31-bit/64-bit addressing mode Perl.

Description of changes:

Makefile.SH
  Changes were made to the os390*) case specific part of the code.
  Support was added for the 64-bit DLL path because the original
  only had support for 31-bit.

hints/os390.sh
  This is the largest set of changes:
   - Compilation and Link options were added for ASCII and 64-bit
   - A z/OS specific check was added to determine if the Perl
     code being built is ASCII or EBCDIC. The check works by
     looking at the first character of the shell script to see
     if it is an ASCII or non-ASCII character. If ASCII, then
     the build is deemed to be ASCII. If not ASCII, it is assumed
     to be EBCDIC.
   - Cleanup was performed to remove code for z/OS systems that are
     no longer supported, simplifying the file (e.g.
        "`uname -v`x`uname -r`" in 02x0[89].*|02x1[0-9].*|[0-9][3-9]x*)
     which would only be true on unsupported, very old pre-z/OS systems
   - The compiler has been changed from xlc to c99. Both are available
     as priced features of the operating system, and the c99 compiler is
     a better 'fit' for options processing, being more consistent with
     c99 on other platforms.
   - Suppressing warning messages for CCN3159 were added because the
     1-bit bitfields flagged due to a smaller-than-int data type are
     harmless.
   - Several feature test macros were added to bring the compilation up
     to a modern level to enable Perl to take advantage of capabilities
     available on all supported z/OS 2.4 and up systems.
   - Removed the -Wl,EDIT=NO because debug information is no longer stored
     in an area that will be loaded into memory, but is now stored in a
     NOLOAD section. So - while this does mean that the binary on disk is a
     little 'fat', what is loaded into memory is not, and it means that
     people can have better problem determination tools available even on
     production Perl distributions.

2 years agoMike Fulton is now a Perl author
Karl Williamson [Thu, 9 Dec 2021 01:42:50 +0000 (18:42 -0700)]
Mike Fulton is now a Perl author

2 years agoSimplify IV abs operation in pp_abs.
TAKAI Kousuke [Fri, 8 Oct 2021 13:58:54 +0000 (22:58 +0900)]
Simplify IV abs operation in pp_abs.

Transforming -iv into "(UV)-(iv + 1) + 1" can avoid signed integer
overflow even if iv was IV_MIN in 2's compelement representation
(as long as iv < 0), so that it makes special treatment for IV_MIN
unnecessary and saves one conditional jump.

2 years agoUnify SETu() calls in pp_abs.
TAKAI Kousuke [Thu, 7 Oct 2021 17:02:04 +0000 (02:02 +0900)]
Unify SETu() calls in pp_abs.

SETu() is a relatively complex macro and calling it in multiple places
will lead bloating of compiled code.  Unifying them with intermediate
variable may save a few hundred bytes.

2 years agoReplace SvUV_nomg(sv) with SvUVX(sv) in pp_abs.
TAKAI Kousuke [Thu, 7 Oct 2021 15:51:55 +0000 (00:51 +0900)]
Replace SvUV_nomg(sv) with SvUVX(sv) in pp_abs.

Under the conditions SvIOK(sv) and SvIsUV(sv), SvUV_nomg(sv) is
equivalent to SvUVX(sv).  This change will eliminate unreachable code
and may save a few dozen bytes of code size.

2 years agoRemove unnecessary braces in t/op/array.t
Paul "LeoNerd" Evans [Wed, 8 Dec 2021 13:37:52 +0000 (13:37 +0000)]
Remove unnecessary braces in t/op/array.t

2 years agoUse builtin::reftype/refaddr in .t files
Paul "LeoNerd" Evans [Sat, 4 Dec 2021 13:08:08 +0000 (13:08 +0000)]
Use builtin::reftype/refaddr in .t files

2 years agoUse builtin::weaken() in .t files in lib/ + ext/
Paul "LeoNerd" Evans [Fri, 3 Dec 2021 18:03:57 +0000 (18:03 +0000)]
Use builtin::weaken() in .t files in lib/ + ext/

2 years agoUse builtin::weaken() in t/
Paul "LeoNerd" Evans [Fri, 3 Dec 2021 17:56:56 +0000 (17:56 +0000)]
Use builtin::weaken() in t/

2 years agoMerge branch 'builtin-ref-utils' into blead
Paul "LeoNerd" Evans [Wed, 8 Dec 2021 00:05:30 +0000 (00:05 +0000)]
Merge branch 'builtin-ref-utils' into blead

2 years agoGive blessed() the same TRUEBOOL optimisation that ref() has in boolean contexts
Paul "LeoNerd" Evans [Fri, 3 Dec 2021 22:42:26 +0000 (22:42 +0000)]
Give blessed() the same TRUEBOOL optimisation that ref() has in boolean contexts

2 years agoAdd builtin::blessed, refaddr and reftype
Paul "LeoNerd" Evans [Fri, 3 Dec 2021 21:23:00 +0000 (21:23 +0000)]
Add builtin::blessed, refaddr and reftype

2 years agoTest equivalence of 'true' and 'false' to negated statements 19252/head
James E Keenan [Wed, 1 Dec 2021 13:04:45 +0000 (13:04 +0000)]
Test equivalence of 'true' and 'false' to negated statements

The documentation for lib/builtin.pm asserts that 'true' is equivalent
to !!1 or !0, and that false is equivalent to !!0 or !1.  Demonstrate
that this is so.

Per review by Paul Evans in https://github.com/Perl/perl5/pull/19252,
we'll use cmp_ok() rather than is() and test for each of 'eq' and '=='.

2 years agoPathTools: update bug_tracker location
Michiel Beijen [Sat, 4 Dec 2021 14:42:18 +0000 (15:42 +0100)]
PathTools: update bug_tracker location

Unlist Ken Williams as maintainer as requested in
https://rt.cpan.org/Public/Bug/Display.html?id=116342

For: https://github.com/Perl/perl5/pull/19261

2 years agot/perf/optcount.t for pushdefer no longer needs the $debug flag
Paul "LeoNerd" Evans [Tue, 7 Dec 2021 17:00:41 +0000 (17:00 +0000)]
t/perf/optcount.t for pushdefer no longer needs the $debug flag

2 years agomktables: Use mnemonic variable names
Karl Williamson [Tue, 7 Dec 2021 15:59:14 +0000 (08:59 -0700)]
mktables: Use mnemonic variable names

Spotted by Dagfinn Ilmari Mannsåker

2 years agoFix unicore/mktables to avoid any @_ accesses in signatured subs
Paul "LeoNerd" Evans [Tue, 7 Dec 2021 00:17:44 +0000 (00:17 +0000)]
Fix unicore/mktables to avoid any @_ accesses in signatured subs

2 years agoMerge branch 'do-not-count-tests-if-possible' into blead
James E Keenan [Tue, 7 Dec 2021 01:49:15 +0000 (01:49 +0000)]
Merge branch 'do-not-count-tests-if-possible' into blead

2 years agoadd {} around the now two lines introduced by f7f919a0
Tony Cook [Mon, 6 Dec 2021 23:16:25 +0000 (10:16 +1100)]
add {} around the now two lines introduced by f7f919a0

This turned out to be harmless, as sv_setpvn_fresh() does nothing
when h_addr is NULL, but the call is also unnecessary when h_addr
is NULL, and possibly confusing to future maintainers.

CID 343917

2 years agobuiltin.pm: Fix pod spelling, slight rewording
Karl Williamson [Sat, 4 Dec 2021 17:07:21 +0000 (10:07 -0700)]
builtin.pm: Fix pod spelling, slight rewording

2 years agodo not count tests, instead use done_testing() 19256/head
Michiel Beijen [Fri, 3 Dec 2021 06:56:08 +0000 (07:56 +0100)]
do not count tests, instead use done_testing()

Having to count tests is annoying for maintainers.

Also, manually updating count tests is problematic when multiple people
are working on the same code; it causes merge conflicts and recounts.

done_testing() is available since Test::More 0.88 which was released in
2009.

This commit changes all tests under lib/ that use Test::More and were
planning the number of tests.

Michiel Beijen is now a Perl author

2 years agoMisc microoptimizations when dealing with new SVs
Richard Leach [Fri, 3 Dec 2021 00:10:51 +0000 (00:10 +0000)]
Misc microoptimizations when dealing with new SVs

In a few places, SVs can be created more efficiently or new SVs
can be assigned to more efficiently. Small changes included:
* Use sv_setpvn_fresh instead of sv_setpvn
* Use sv_mortalcopy_flags instead of sv_newmortal + sv_setsv_flags
* newSVsv_flags instead of newSV + sv_setsv_flags
* sv_newmortal instead of sv_2mortal(newSV(0))
* Remove a SvGROW(sv, 257) following a newSV(257)

2 years agoAdd builtin:: funcs for handling weakrefs
Paul "LeoNerd" Evans [Fri, 3 Dec 2021 13:35:53 +0000 (13:35 +0000)]
Add builtin:: funcs for handling weakrefs

Also, ensure that B::Deparse understands the OA_TARGMY optimisation of
OP_ISBOOL

2 years agoMark scripts, modules and tests as linguist-language=Perl
Dagfinn Ilmari Mannsåker [Fri, 3 Dec 2021 16:31:15 +0000 (16:31 +0000)]
Mark scripts, modules and tests as linguist-language=Perl

Otherwise GitHub thinks some of them are Raku or Prolog.

2 years agoGive files autogenerated by regen/opcode.pl the linguist-generated attribute so githu...
Paul "LeoNerd" Evans [Fri, 3 Dec 2021 16:17:54 +0000 (16:17 +0000)]
Give files autogenerated by regen/opcode.pl the linguist-generated attribute so github hides diffs

2 years agoImprovements to OP_ISBOOL
Paul "LeoNerd" Evans [Thu, 2 Dec 2021 13:06:27 +0000 (13:06 +0000)]
Improvements to OP_ISBOOL

 * Apply OA_RETSCALAR, OA_TARGLEX and OA_FOLDCONST flags
 * Handle both 'get' and 'set' magic

2 years agofix redundant apidoc warning
Tony Cook [Thu, 2 Dec 2021 00:12:03 +0000 (11:12 +1100)]
fix redundant apidoc warning

fixes #19250

2 years agoDirect optree implementations of builtin:: functions
Paul "LeoNerd" Evans [Tue, 30 Nov 2021 17:37:13 +0000 (17:37 +0000)]
Direct optree implementations of builtin:: functions

Turn builtin::true/false into OP_CONSTs

Add a dedicated OP_ISBOOL, make an efficient op version of builtin::isbool()

2 years agoMerge branch 'hydahy/fix-gh19249' into blead
James E Keenan [Tue, 30 Nov 2021 23:19:05 +0000 (23:19 +0000)]
Merge branch 'hydahy/fix-gh19249' into blead

For: p.r. https://github.com/Perl/perl5/pull/19251;
issue: https://github.com/Perl/perl5/issues/19249

2 years agofix pod error in sv.c. Closes #19249 19251/head
Richard Leach [Tue, 30 Nov 2021 22:41:00 +0000 (22:41 +0000)]
fix pod error in sv.c. Closes #19249

2 years agobuiltin.c: Fix C++ compilation errors
Dagfinn Ilmari Mannsåker [Tue, 30 Nov 2021 16:07:34 +0000 (16:07 +0000)]
builtin.c: Fix C++ compilation errors

C++ does not allow `goto` across initalisations of variables that are
in scope at the label, so just get rid of the `goto`.

An alternative would be to start a new scope after the first `goto`,
so that the variables aren't in scope any more at the label, but I
think this is neater.

2 years agoAdd a builtin:: namespace, with true/false/isbool
Paul "LeoNerd" Evans [Sat, 20 Nov 2021 16:40:59 +0000 (16:40 +0000)]
Add a builtin:: namespace, with true/false/isbool

This finishes the perl-visible API required for RFC 0008
  https://github.com/Perl/RFCs/blob/master/rfcs/rfc0008.md

It also begins the "builtin::" namespace of RFC 0009
  https://github.com/Perl/RFCs/blob/master/rfcs/rfc0009.md

2 years agonewSVpvn_flags().. is more efficient than sv_2mortal(newSVpvn(..))
Richard Leach [Tue, 23 Nov 2021 23:35:58 +0000 (23:35 +0000)]
newSVpvn_flags().. is more efficient than sv_2mortal(newSVpvn(..))

The same holds for newSVpvs* wrappers around newSVpvn* functions.

2 years agonewSVpvn_flags(x, .. ,SVs_TEMP) more efficient than sv_2mortal(newSVpv(x,0))
Richard Leach [Wed, 24 Nov 2021 19:10:05 +0000 (19:10 +0000)]
newSVpvn_flags(x, .. ,SVs_TEMP) more efficient than sv_2mortal(newSVpv(x,0))

2 years agoAdd a phase_name() macro.
Felipe Gasper [Thu, 5 Aug 2021 20:01:44 +0000 (16:01 -0400)]
Add a phase_name() macro.

2 years agoAlso C<codeword> quote "defer" and "goto"
Paul "LeoNerd" Evans [Tue, 23 Nov 2021 20:49:22 +0000 (20:49 +0000)]
Also C<codeword> quote "defer" and "goto"

2 years agoQuote the word "defer" in exception messages about control flow
Paul "LeoNerd" Evans [Tue, 23 Nov 2021 18:04:19 +0000 (18:04 +0000)]
Quote the word "defer" in exception messages about control flow

2 years agoForbid using 'goto' to jump into a 'defer' block because everything will break when...
Paul "LeoNerd" Evans [Mon, 22 Nov 2021 21:58:33 +0000 (21:58 +0000)]
Forbid using 'goto' to jump into a 'defer' block because everything will break when it's done

2 years agoupdate perldsc examples to be strict compliant
Graham Knop [Mon, 22 Nov 2021 16:51:57 +0000 (17:51 +0100)]
update perldsc examples to be strict compliant

Where possible, update perldsc examples to use lexical variables, to be
strict compliant. Earlier code in this document specifically discusses
differences with strict, but the examples aren't really related to
anything about non-lexical variables, so they should be updated to work
with modern standards.

Some parts of the examples have not been updated because they are using
variables that are implicitly meant to come from some an outside source.

2 years agoadd missing brace in perldsc hash of hashes example
Graham Knop [Sun, 21 Nov 2021 13:18:57 +0000 (14:18 +0100)]
add missing brace in perldsc hash of hashes example

2 years agoFixup Corelist.pm
Richard Leach [Mon, 22 Nov 2021 13:21:25 +0000 (13:21 +0000)]
Fixup Corelist.pm