This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perl5.git
8 years agoAvoid %Config check on Errno load if it was built with PERL_BUILD_EXPAND_CONFIG_VARS
Todd Rinaldo [Wed, 26 Aug 2015 21:49:58 +0000 (16:49 -0500)]
Avoid %Config check on Errno load if it was built with PERL_BUILD_EXPAND_CONFIG_VARS

Any person who built perl with this environment variable already has locked their
install to the given platform. Therefore this check should be unnecessary on
those installs. This reduces runtime bloat because Config does not have to be
loaded any time someone uses $! or Errno directly.

8 years agoDo not inject use Config into Dynaloader.pm when PERL_BUILD_EXPAND_CONFIG_VARS
Todd Rinaldo [Wed, 26 Aug 2015 20:21:22 +0000 (15:21 -0500)]
Do not inject use Config into Dynaloader.pm when PERL_BUILD_EXPAND_CONFIG_VARS

The rest of the file automatically expanded Config variables, however the
module was still accidentally loaded. This commit corrects the oversight.

8 years agoOne more FD_CLOEXEC case, missed in 131d45a9.
Jarkko Hietaniemi [Wed, 26 Aug 2015 23:57:08 +0000 (19:57 -0400)]
One more FD_CLOEXEC case, missed in 131d45a9.

8 years agoExplicitly use and check for FD_CLOEXEC.
Jarkko Hietaniemi [Wed, 26 Aug 2015 12:55:37 +0000 (08:55 -0400)]
Explicitly use and check for FD_CLOEXEC.

This may break places which have the FD_CLOEXEC functionality
but do not have the FD_CLOEXEC define.

In any case, using a boolean for the F_SETFD flag is icky.
Using an explicit 1 is also dubious.

8 years agoNote that the all the fd flags are saved/restored.
Jarkko Hietaniemi [Wed, 26 Aug 2015 12:53:45 +0000 (08:53 -0400)]
Note that the all the fd flags are saved/restored.

FD_CLOEXEC is currently usually the only defined fd flag
for F_GETFD/F_SETFD, but let's not assume that.

8 years agolib/utf8.t: EBCDIC fixes
Karl Williamson [Mon, 18 May 2015 17:16:18 +0000 (11:16 -0600)]
lib/utf8.t: EBCDIC fixes

Some of the test chose code points that did not match its assumptions as
to their classifications.

And some of the tests were extended to work on 1047 EBCDIC

8 years agot/op/split.t: Generalize for EBCDIC
Karl Williamson [Mon, 18 May 2015 16:18:51 +0000 (10:18 -0600)]
t/op/split.t: Generalize for EBCDIC

Whatever the bug was that caused some of these to need to be skipped,
it's gone now.  Also some of the tests are easily adapted to work on
EBCDIC platforms.

8 years agoperlguts: Wrap macro name with C<>
Karl Williamson [Thu, 7 May 2015 03:05:19 +0000 (21:05 -0600)]
perlguts: Wrap macro name with C<>

8 years agot/op/utf8decode.t: Better SKIP message
Karl Williamson [Mon, 18 May 2015 16:30:57 +0000 (10:30 -0600)]
t/op/utf8decode.t: Better SKIP message

8 years agolib/utf8.t: Add some tests to stress EBCDIC
Karl Williamson [Mon, 18 May 2015 16:47:50 +0000 (10:47 -0600)]
lib/utf8.t: Add some tests to stress EBCDIC

The tests for the Latin1 \xFF aren't a fair test of UTF-8 on EBCDIC
platforms, because it is generally a UTF-8 invariant character, so is
the same regardless of being in UTF-8 or not.  This adds some tests
where the UTF-EBCDIC version is 2 bytes (as well as the UTF-8 version).

8 years agot/base/lex.t: Use more standard test for EBCDIC
Karl Williamson [Mon, 18 May 2015 16:02:08 +0000 (10:02 -0600)]
t/base/lex.t: Use more standard test for EBCDIC

This makes it easier to grep for these things.  The typical test is for
the ord("A"), not some other character.  Since this is in t/base, it
doesn't use helper scripts.

8 years agot/op/tr.t: Clarify skip tests message
Karl Williamson [Fri, 15 May 2015 19:34:07 +0000 (13:34 -0600)]
t/op/tr.t: Clarify skip tests message

8 years agoop/chr.t: Better skip message
Karl Williamson [Wed, 19 Aug 2015 01:49:02 +0000 (19:49 -0600)]
op/chr.t: Better skip message

8 years agoVarious .t files: Use globals to see if on EBCDIC
Karl Williamson [Fri, 3 Apr 2015 18:06:39 +0000 (12:06 -0600)]
Various .t files: Use globals to see if on EBCDIC

These globals are already available; by using them instead of rolling
our own, it makes it easer to grep for these kinds of instances.

8 years agoRevert "Update Pod-Simple to CPAN version 3.31"
Tony Cook [Tue, 25 Aug 2015 02:08:45 +0000 (12:08 +1000)]
Revert "Update Pod-Simple to CPAN version 3.31"

This reverts commit 354f3e4ea74293dacec2ca84d3762435e9c45701.

This broken Win32 builds, see https://github.com/perl-pod/pod-simple/issues/69

8 years agoperldelta: Fix typo
Karl Williamson [Mon, 24 Aug 2015 20:07:32 +0000 (14:07 -0600)]
perldelta: Fix typo

Spotted by Lukas Mai

8 years agotest implicit anchors using re.pm [perl #125810]
Lukas Mai [Mon, 24 Aug 2015 19:43:11 +0000 (21:43 +0200)]
test implicit anchors using re.pm [perl #125810]

8 years agoimplicitly anchor .{0,} like .* [perl #125810]
Lukas Mai [Mon, 24 Aug 2015 19:42:38 +0000 (21:42 +0200)]
implicitly anchor .{0,} like .* [perl #125810]

8 years agoregexec.c: Move a #define next to related code
Karl Williamson [Sun, 23 Aug 2015 16:45:43 +0000 (10:45 -0600)]
regexec.c: Move a #define next to related code

One message here uses a static array, and one uses a #define.  I don't
think it really matters, but they should be adjacent.

8 years agoOutput bad locale warning in regex synthetic start class
Karl Williamson [Sun, 23 Aug 2015 16:45:22 +0000 (10:45 -0600)]
Output bad locale warning in regex synthetic start class

perl detects some locale errors when a new locale is entered.  It stores
these up to output upon first use of something that uses that locale.  A
synthetic start class (SSC) is used by the regex optimizer under certain
circumstances.  Prior to this patch, it was possible for the stored up
bad locale message to not be raised if the match failed the SSC.  This
patch fixes this by changing the node type of the SSC to be one that
checks for the stored-up message should there be locale-dependent
portions of the pattern.

8 years agoPATCH: [perl 125825] {n}+ possessive quantifier broken
Karl Williamson [Mon, 24 Aug 2015 18:50:47 +0000 (12:50 -0600)]
PATCH: [perl 125825] {n}+ possessive quantifier broken

I was unaware of this construct when I wrote the commit that broke it,
and there were no tests for it.  Now there are.

8 years agoFurther clarification to [perl #125805] perldelta
Karl Williamson [Mon, 24 Aug 2015 19:35:52 +0000 (13:35 -0600)]
Further clarification to [perl #125805] perldelta

8 years agoMake qr/(?[ ])/ work in UTF-8 locales
Karl Williamson [Sun, 23 Aug 2015 16:30:02 +0000 (10:30 -0600)]
Make qr/(?[ ])/ work in UTF-8 locales

Previously use of this under /l regex rules was a compile time error.
Now it works like \b{wb} and \b{sb}, which compile under locale rules
and always work like Unicode says they should.  A UTF-8 locale implies
Unicode rules, and the goal is for it to work seamlessly with the rest
of perl.  This construct was the only one I am aware of that didn't work
seamlessly (not counting OS interfaces) under UTF-8 LC_CTYPE locales.

For all three of these constructs, use with a non-UTF-8 runtime locale
raises a warning, and Unicode rules are used anyway.

UTF-8 locale collation still has problems, but this is low priority to
fix, as it's a lot of work, and if one really cares, one should be using
Unicode::Collate.

8 years agoregcomp.c: Add a parameter to static function
Karl Williamson [Sun, 23 Aug 2015 16:25:16 +0000 (10:25 -0600)]
regcomp.c: Add a parameter to static function

This will be used by the next commit

8 years agoregcomp.h: Fold 2 ANYOF flags into a single one
Karl Williamson [Sat, 22 Aug 2015 04:21:57 +0000 (22:21 -0600)]
regcomp.h: Fold 2 ANYOF flags into a single one

The ANYOF_FLAGS bits are all used up, but a future commit wants one.
This commit frees up a bit by sharing two of the existing
comparatively-rarely-used ones.  One bit is used only under /d matching
rules, while the other is used only when not under /d.  Only the latter
bit is used in synthetic start classes.  The previous commit introduced
an ANYOFD node type corresponding to /d.  An SSC never is this type.
Thus, the bits have mutually exclusive meanings, and we can use the node
type to distinguish between the two meanings of the combined bit.

An alternative implementation would have been to use the
ANYOF_HAS_NONBITMAP_NON_UTF8_MATCHES non-/d bit instead of the one
chosen.  But this is used more frequently, so the disambiguation would
have been exercised more frequently, slowing execution down ever so
slightly; more importantly, this one required fewer code changes, by a
slight amount.

8 years agoAdd ANYOFD regex node
Karl Williamson [Fri, 21 Aug 2015 19:06:53 +0000 (13:06 -0600)]
Add ANYOFD regex node

This is like an ANYOF node, but just for when /d is in effect.  It will
be used in future commits

8 years agoperldebguts: Add clarification
Karl Williamson [Fri, 21 Aug 2015 15:54:05 +0000 (09:54 -0600)]
perldebguts: Add clarification

8 years agoperldelta: Improve wording for [perl #125805]
Karl Williamson [Mon, 24 Aug 2015 17:17:46 +0000 (11:17 -0600)]
perldelta: Improve wording for [perl #125805]

8 years agopodcheck.t: regenerate db
Karl Williamson [Mon, 24 Aug 2015 17:03:18 +0000 (11:03 -0600)]
podcheck.t: regenerate db

Commit e128eaa17ab039e9db53073c7ac6c5093b3628d9 introduced 2 new overly
long verbatim pod lines that were causing podcheck.t failures in
pedantic mode.  This suppresses those failures.

8 years agoPATCH: [perl #125805] Perl segfaults with a regex_sets error message
Karl Williamson [Mon, 24 Aug 2015 03:39:04 +0000 (21:39 -0600)]
PATCH: [perl #125805] Perl segfaults with a regex_sets error message

This fix required an extra test of the return value of a function.

8 years agoUpdate Pod-Simple to CPAN version 3.31
Chris 'BinGOs' Williams [Mon, 24 Aug 2015 10:06:47 +0000 (11:06 +0100)]
Update Pod-Simple to CPAN version 3.31

  [DELTA]

2015-08-23   Marc Green <marcgreen@cpan.org>
  * Release 3.31
  No changes since 3.30_1.

2015-07-19   Marc Green <marcgreen@cpan.org>
  * Release 3.30_1
  Simplified the detection of case-insensitivity in Pod::Simple::Search.

  Fixed "Use of uninitialized value $1 in lc" warning in
  Pod::Simple::Search.

  If @INC includes the current directory symbol, '.', the survey()
  method of Pod::Simple::Search no longer excludes it from its list
  of directories to search. Instead, The survey() and find() methods
  now both exclude duplicate directories from @INC (RT #102344).

  Moved source repository and updated links to new perl-pod GitHub
  organization: https://github.com/perl-pod/pod-simple.

  Improved repository links and added GitHub issue tracking link to
  the distribution metadata.

  Switched from File::Spec's catdir to catfile for path names, to
  fix failures on VMS. Also now use Unix path semantics where
  they're not required to be platform-specific. Thanks to Craig A.
  Berry for the patch (RT #105511).

  Improved the example use of the 'html_encode_chars()' method in
  the Pod::Simple::XHTML documentation. Patch from Randy Stauner.

8 years agoUpgrade to Thread::Queue 3.06
Jerry D. Hedden [Sat, 22 Aug 2015 20:40:50 +0000 (16:40 -0400)]
Upgrade to Thread::Queue 3.06

For: RT #125864

8 years agoAdd missing URL for 5.23.2 release announcement
Steve Hay [Sat, 22 Aug 2015 22:38:32 +0000 (23:38 +0100)]
Add missing URL for 5.23.2 release announcement

8 years agoAdd epigraph for 5.20.3-RC1
Steve Hay [Sat, 22 Aug 2015 22:37:10 +0000 (23:37 +0100)]
Add epigraph for 5.20.3-RC1

8 years agoPerl 5.20.3-RC1 today
Steve Hay [Sat, 22 Aug 2015 20:27:24 +0000 (21:27 +0100)]
Perl 5.20.3-RC1 today

8 years agoImport Module::CoreList changes for 5.20.3-RC1
Steve Hay [Sat, 22 Aug 2015 20:22:37 +0000 (21:22 +0100)]
Import Module::CoreList changes for 5.20.3-RC1

8 years agoRemove superfluous line in code sample.
James E Keenan [Sat, 22 Aug 2015 00:24:52 +0000 (20:24 -0400)]
Remove superfluous line in code sample.

Per suggestion by Egor Korablev in RT #125860.

8 years agoPOSIX: version bump for d7a0f0b
Jarkko Hietaniemi [Fri, 21 Aug 2015 12:33:21 +0000 (08:33 -0400)]
POSIX: version bump for d7a0f0b

8 years agoPOSIX: mention the Inf, NaN constants; other small tweaks
Jarkko Hietaniemi [Fri, 21 Aug 2015 12:25:10 +0000 (08:25 -0400)]
POSIX: mention the Inf, NaN constants; other small tweaks

8 years agomktables: Comment changes only
Karl Williamson [Thu, 20 Aug 2015 17:52:51 +0000 (11:52 -0600)]
mktables: Comment changes only

8 years agomktables: Move file handling to non-exceptional order
Karl Williamson [Thu, 20 Aug 2015 17:50:39 +0000 (11:50 -0600)]
mktables: Move file handling to non-exceptional order

The DAge.txt property until the previous commit had to be handled
out-of-the-normal order.  This is no longer required.

8 years agomktables: Revamp the compare versions functionality
Karl Williamson [Thu, 20 Aug 2015 17:35:21 +0000 (11:35 -0600)]
mktables: Revamp the compare versions functionality

This functionality is rarely used, but enables someone to see what
Unicode has changed between releases X and Y, without the clutter of the
things that are added after X came out.  In other words it compiles
release X using Y's rules.  To use it, you must go in and edit mktables
to specify to use this; so it is intended only for a developer who wants
to look at Unicode history.  One use I've done is to look at the beta
version of a new release to compare with the previous official one.
This allows me to find typos, and unintentional changes and report them
back to Unicode.

This commit significantly overhauls this feature, giving better results
than before.

8 years agomktables: Fix so -annotate works on early Unicodes
Karl Williamson [Thu, 20 Aug 2015 17:03:47 +0000 (11:03 -0600)]
mktables: Fix so -annotate works on early Unicodes

There were several glitches when compiling very early Unicode releases.
This commit changes things so the age property reference is stored in a
global, and doesn't have to be refound multiple times.

8 years agomktables: Move code to common functions
Karl Williamson [Thu, 20 Aug 2015 16:42:36 +0000 (10:42 -0600)]
mktables: Move code to common functions

This takes two code sections and moves them to a function each.  For
one, this is in preparation for being used in a 2nd place.  For the
other, call the code in existing other places.

8 years agomktables: Fix up property calc for early Unicodes
Karl Williamson [Thu, 20 Aug 2015 16:48:36 +0000 (10:48 -0600)]
mktables: Fix up property calc for early Unicodes

The Default_Ignorable_Code_Point property is applicable to unassigned
code points, so shouldn't restrict our calculated value to assigned.
(We calculate what the property would be when run on Unicode releases
that haven't defined it yet.)

8 years agomktables: Use mnemonic instead of hex constant
Karl Williamson [Thu, 20 Aug 2015 16:20:21 +0000 (10:20 -0600)]
mktables: Use mnemonic instead of hex constant

These constants are used in more than one place.  Use a common variable
instead of repeating the hex numbers

8 years agoModule-CoreList-5.20150820 is now on CPAN
Chris 'BinGOs' Williams [Thu, 20 Aug 2015 17:30:55 +0000 (18:30 +0100)]
Module-CoreList-5.20150820 is now on CPAN

8 years agoBump the perl version in various places for 5.23.3.
Matthew Horsfall [Thu, 20 Aug 2015 16:09:57 +0000 (12:09 -0400)]
Bump the perl version in various places for 5.23.3.

8 years agoPorting/new-perldelta.pl regenerations
Matthew Horsfall [Thu, 20 Aug 2015 15:51:51 +0000 (11:51 -0400)]
Porting/new-perldelta.pl regenerations

8 years agoFix TBD so podcheck.t is happy
Matthew Horsfall [Thu, 20 Aug 2015 15:50:51 +0000 (11:50 -0400)]
Fix TBD so podcheck.t is happy

8 years agoUpdate release schedule
Matthew Horsfall [Thu, 20 Aug 2015 15:43:27 +0000 (11:43 -0400)]
Update release schedule

8 years agoAdd epigraph for v5.23.2.
Matthew Horsfall [Thu, 20 Aug 2015 15:42:39 +0000 (11:42 -0400)]
Add epigraph for v5.23.2.

8 years agoadd new release to perlhist v5.23.2
Matthew Horsfall [Thu, 20 Aug 2015 14:25:06 +0000 (10:25 -0400)]
add new release to perlhist

8 years agoFinalize perldelta
Matthew Horsfall [Thu, 20 Aug 2015 14:24:02 +0000 (10:24 -0400)]
Finalize perldelta

8 years agoAdd .gitignore for ext/re/ generated header file
Matthew Horsfall [Thu, 20 Aug 2015 14:08:43 +0000 (10:08 -0400)]
Add .gitignore for ext/re/ generated header file

8 years agoUpdate Module::CoreList for 5.23.2
Matthew Horsfall [Thu, 20 Aug 2015 14:06:04 +0000 (10:06 -0400)]
Update Module::CoreList for 5.23.2

8 years agoUpdate list of files to clean for ceab18aaa.
Matthew Horsfall [Thu, 20 Aug 2015 13:58:38 +0000 (09:58 -0400)]
Update list of files to clean for ceab18aaa.

8 years agoLet Porting/makerel know about overload.c's rename to overload.inc
Matthew Horsfall [Thu, 20 Aug 2015 13:30:34 +0000 (09:30 -0400)]
Let Porting/makerel know about overload.c's rename to overload.inc

8 years agoUpdate versions in INSTALL.
Matthew Horsfall [Thu, 20 Aug 2015 12:07:46 +0000 (08:07 -0400)]
Update versions in INSTALL.

8 years agoperldelta updates for 5.23.2.
Matthew Horsfall [Thu, 20 Aug 2015 12:05:16 +0000 (08:05 -0400)]
perldelta updates for 5.23.2.

8 years agob992490d copied wrong for ext re.
Jarkko Hietaniemi [Thu, 20 Aug 2015 13:32:56 +0000 (09:32 -0400)]
b992490d copied wrong for ext re.

This has been magically working since ext re builds with -I../..,
and so picks up the inline headers from the top, the copied bogus
file has been left unused.

8 years ago[perl #125669] op/pack.t failures with PPC long double (double double) builds
Sisyphus [Thu, 20 Aug 2015 11:28:33 +0000 (07:28 -0400)]
[perl #125669] op/pack.t failures with PPC long double (double double) builds

unpack '%65...' failures, to be more exact.

8 years agoperldelta for 668fcfea6, a1e27170f
Tony Cook [Thu, 20 Aug 2015 01:24:31 +0000 (11:24 +1000)]
perldelta for 668fcfea6a1e27170f

8 years ago[perl 125760] fix new (and one old test) to pass with PERL_UNICODE
Tony Cook [Thu, 20 Aug 2015 00:32:03 +0000 (10:32 +1000)]
[perl 125760] fix new (and one old test) to pass with PERL_UNICODE

8 years agoUpdate Term-Cap to CPAN version 1.17
Chris 'BinGOs' Williams [Wed, 19 Aug 2015 14:47:09 +0000 (15:47 +0100)]
Update Term-Cap to CPAN version 1.17

  [DELTA]

1.16: Sat  5 Apr 10:19:35 BST 2014
    - Make last resort actually work from drm00
      - Removed change log from Cap.pm

1.17-RC1: Wed  1 Jul 10:30:15 BST 2015
    - Fix regression caused by last resort change
    - Add support for capabilities of more than 2 characters

1.17: Mon 17 Aug 08:30:54 BST 2015
    - No changes version bounce

8 years agock_refassign: selectively copy OPpPAD_INTRO/STATE
David Mitchell [Mon, 17 Aug 2015 15:47:04 +0000 (16:47 +0100)]
ck_refassign: selectively copy OPpPAD_INTRO/STATE

Previously this function unconditionally copied the OPpLVAL_INTRO and
OPpPAD_STATE flags from the LH var op to the refassign op, even when those
flag bits weren't used or meant something different.

This commit makes the copying more selective.

It also makes clear by code comments and asserts, that the refassign
op uses bit 6, OPpPAD_STATE, to mean either that or OPpOUR_INTRO
depending on the type of LHS.

I couldn't think of any test that would would break under the old regime,
but this future-proofs the code against new flags and meanings.

8 years agot/perf/benchmarks: 5.004 compat
David Mitchell [Mon, 17 Aug 2015 14:39:14 +0000 (15:39 +0100)]
t/perf/benchmarks: 5.004 compat

make the tests in the benchmark file be compilable back to 5.004_05. (To
go further back, it would need to avoid package names that start with
digits, such as 'call::sub::3_args').

Basically avoid // and our.

8 years ago[perl #125467] mingw-w64 has moved
Tony Cook [Wed, 5 Aug 2015 05:51:20 +0000 (15:51 +1000)]
[perl #125467] mingw-w64 has moved

8 years ago[perl #125826] make the buffer large enough in TRIE_STORE_REVCHAR
Tony Cook [Wed, 19 Aug 2015 04:35:29 +0000 (14:35 +1000)]
[perl #125826] make the buffer large enough in TRIE_STORE_REVCHAR

Since the SV is discarded almost immediately (in non-DEBUGGING builds)
don't worry about making it the smallest possible size.

8 years agomktables: Add code point ages to --annotate option
Karl Williamson [Tue, 18 Aug 2015 20:47:48 +0000 (14:47 -0600)]
mktables: Add code point ages to --annotate option

This can be useful information.

8 years agodisallow nested declarations [perl #125587] [perl #121058]
Lukas Mai [Mon, 17 Aug 2015 19:59:41 +0000 (21:59 +0200)]
disallow nested declarations [perl #125587] [perl #121058]

8 years agoAlso ignore CONTRIBUTING.md for dual-life modules
H.Merijn Brand [Tue, 18 Aug 2015 11:18:17 +0000 (13:18 +0200)]
Also ignore CONTRIBUTING.md for dual-life modules

The .md extension has become more and more standard on github

8 years ago[perl #125781] handle range overflow when Size_t is smaller than IV
Tony Cook [Tue, 11 Aug 2015 05:49:37 +0000 (15:49 +1000)]
[perl #125781] handle range overflow when Size_t is smaller than IV

8 years agoClarify functioning of '||' operator.
Ludovic E. R. Tolhurst-Cleaver [Tue, 18 Aug 2015 01:30:59 +0000 (21:30 -0400)]
Clarify functioning of '||' operator.

Follow wording from Camel book, 4th ed., p. 120, per suggestion by
Ludovic E. R. Tolhurst-Cleaver.  Add Ludovic E. R. Tolhurst-Cleaver
to AUTHORS.

For: RT #125802

8 years ago[perl #120826] - Fix documentation nit (thanks Eric Brine.)
Matthew Horsfall [Mon, 17 Aug 2015 13:39:59 +0000 (09:39 -0400)]
[perl #120826] - Fix documentation nit (thanks Eric Brine.)

8 years ago[MERGE] re-implement OPpASSIGN_COMMON mechanism
David Mitchell [Mon, 17 Aug 2015 10:17:01 +0000 (11:17 +0100)]
[MERGE] re-implement OPpASSIGN_COMMON mechanism

8 years agofix a SV_NOSTEAL issue in pp_aassign
David Mitchell [Fri, 14 Aug 2015 08:23:59 +0000 (09:23 +0100)]
fix a SV_NOSTEAL issue in pp_aassign

in something like (...) = (f())[0,0]

A mortal SV can appear multiple times on the RHS without being reference
counted. If it's a string, the temptation is to steal its string buffer
during the first copy; but this would make the second usage undef.

pp_aassign() already takes account of this and uses the SV_NOSTEAL
flag when copying - except that one common code path didn't.

This commit fixes that, adds more tests, and adds more code comments
to explain the issue.

8 years agofix PAD_COMPNAME_GEN documentation
David Mitchell [Thu, 13 Aug 2015 11:26:06 +0000 (12:26 +0100)]
fix PAD_COMPNAME_GEN documentation

The generation number is no longer stored in the SvUVX() field

8 years agodocument what PL_generation is for
David Mitchell [Thu, 13 Aug 2015 11:21:54 +0000 (12:21 +0100)]
document what PL_generation is for

8 years agoEliminate GvASSIGN_GENERATION and _set macros
David Mitchell [Thu, 13 Aug 2015 11:07:38 +0000 (12:07 +0100)]
Eliminate GvASSIGN_GENERATION and _set macros

Since we no longer scan package vars with PL_generation for
OPpASSIGN_COMMON* purposes, eliminate the macros used for that purpose.

8 years agoOptimise 1 arg in list assign
David Mitchell [Thu, 13 Aug 2015 16:00:32 +0000 (17:00 +0100)]
Optimise 1 arg in list assign

Avoid setting common scalar flags in these cases:

($x) = (...);
(...) = ($x);

8 years agoEliminate PL_sawalias, GPf_ALIASED_SV
David Mitchell [Tue, 11 Aug 2015 15:21:07 +0000 (16:21 +0100)]
Eliminate PL_sawalias, GPf_ALIASED_SV

These two commits:

    v5.21.3-759-gff2a62e "Skip no-common-vars optimisation for aliases"
    v5.21.4-210-gc997e36 "Make list assignment respect foreach aliasing"

added a run-time mechanism to detect aliased package variables,
by either "*pkg = ...," or "for $pkg (...)", and used that information
to enable the OPpASSIGN_COMMON mechanism at runtime for detecting common
elements in a list assign, e.g.

    for $alias ($a, ...) {
        ($a,$b) = (1,$alias);
    }

The previous commit but one changed the OPpASSIGN_COMMON mechanism such
that it no longer uses PL_sawalias. So this var and the mechanism for
setting it can now be removed.

This commit removes:

    * the PL_sawalias variable
    * the GPf_ALIASED_SV GP flag
    * the SAVEt_GP_ALIASED_SV and save_aliased_sv() save type.

8 years agomake my (...) = @_ non-OPpASSIGN_COMMON_RC1
David Mitchell [Thu, 13 Aug 2015 14:01:23 +0000 (15:01 +0100)]
make my (...) = @_ non-OPpASSIGN_COMMON_RC1

Technically in

    my ($scalar,...) = @_

due to closure/goto tricks, its possible for $scalar to appear on both
the LHS and RHS, so we currently set the OPpASSIGN_COMMON_RC1 flag.

However, this imposes extra overhead; for example 5% extra instruction
reads and 11% extra conditional branches for

    my ($x,$y,$z) = @_;

Given what an important construct this is, disable this flag in the
specific case of of only my's on the LHS and only @_ on the RHS.
It's technically incorrect, but its the same behaviour we've always had
(it was only the previous commit which made it safe but slower).

We still set the OPpASSIGN_COMMON_AGG flag for

    my ($...,@a) = @_

since in the normal case this only adds the small additional runtime
overhead of checking that @a is already empty.

8 years agore-implement OPpASSIGN_COMMON mechanism
David Mitchell [Thu, 13 Aug 2015 09:32:42 +0000 (10:32 +0100)]
re-implement OPpASSIGN_COMMON mechanism

This commit almost completely replaces the current mechanism
for detecting and handing common vars in list assignment, e.g.

    ($a,$b) = ($b,$a);

In general outline: it creates more false positives at compile-time
than before, but also no longer misses some false negatives. In
compensation, it considerably reduces the run-time cost of handling
potential and real commonality.

It does this firstly by splitting the OPpASSIGN_COMMON flag into 3
separate flags:

    OPpASSIGN_COMMON_AGG
    OPpASSIGN_COMMON_RC1
    OPpASSIGN_COMMON_SCALAR

which indicate different classes of commonality that can be handled
in different ways at runtime.

Most importantly, it distinguishes between two basic cases. Firstly,
common scalars (OPpASSIGN_COMMON_SCALAR), e.g.

    ($x,....) = (....,$x,...)

where $x is modified and then sometime later its value is used again,
but that value has changed in the meantime. In this case, we need
replace such vars on the RHS with mortal copies before processing the
assign.

The second case is an aggregate on the LHS (OPpASSIGN_COMMON_AGG), e.g.

    (...,@a) = (...., $a[0],...)

In this case, the issue is instead that when @a is cleared, it may free
items on the RHS (due to the stack not being ref counted).  What is
required here is that rather than making of a copy of each RHS element and
storing it in the array as we progress, we make *all* the copies *before*
clearing the array, but mortalise them in case we die in the meantime.

We can further distinguish two scalar cases; sometimes it's possible
to confirm non-commonality at run-time merely by checking that all
the LHS scalars have a reference count of 1. If this is possible,
we set the OPpASSIGN_COMMON_RC1 flag rather than the
OPpASSIGN_COMMON_SCALAR flag.

The major improvement in the run-time performance in the
OPpASSIGN_COMMON_SCALAR case (or OPpASSIGN_COMMON_RC1 if rc>1 scalars are
detected), is to use a mark-and-sweep scan of the two lists using the
SVf_BREAK flag, to determine which elements are common, and only make
mortal copies of those elements.  This has a very big effect on run-time
performance; for example in the classic

    ($a,$b) = ($b,$a);

it would formerly make temp copies of both $a and $b; now it only
copies $a.

In more detail, the mark and sweep mechanism in pp_aassign works by
looping through each LHS and RHS SV pair in parallel. It temporarily marks
each LHS SV with the SVf_BREAK flag, then makes a copy of each RHS element
only if it has the SVf_BREAK flag set. When the scan is finished, the flag
is unset on all LHS elements.

One major change in compile-time flagging is that package scalar vars are
now treated as if they could always be aliased. So we don't bother any
more to do the compile-time PL_generation checking on package vars (we
still do it on lexical vars). We also no longer make use of the run-time
PL_sawalias mechanism for detecting aliased package vars (and indeed the
next commit but one will remove that mechanism). This means that more list
assignment expressions which feature package vars will now need to
do a runtime mark-and-sweep (or where appropriate, RC1) test. In
compensation, we no longer need to test for aliasing and set PL_sawalias
in pp_gvsv and pp_gv, nor reset PL_sawalias in every pp_nextstate.

Part of the reasoning behind this is that it's nearly impossible to detect
all possible package var aliasing; for example PL_sawalias would fail to
detect XS code doing GvSV(gv) = sv.

Note that we now scan the two children of the OP_AASSIGN separately,
and in particular we mark lexicals with PL_generation only on the
LHS and test only on the RHS. So something like

    ($x,$y) = ($default, $default)

will no longer be regarded as having common vars.

In terms of performance, running Porting/perlbench.pl on the new
expr::aassign:: tests in t/perf/benchmarks show that the biggest slowdown
is around 13% more instruction reads and 20% more conditional branches in
this:
        setup   => 'my ($v1,$v2,$v3) = 1..3; ($x,$y,$z) = 1..3;',
        code    => '($x,$y,$z) = ($v1,$v2,$v3)',

where this is now a false positive due to the presence of package
variables.

The biggest speedup is 50% less instruction reads and conditional branches
in this:

        setup   => '@_ = 1..3; my ($x,$y,$z)',
        code    => '($x,$y,$z) = @_',

because formerly the presence of @_ pessimised things if the LHS wasn't
a my declaration (it's still pessimised, but the runtime's faster now).

Conversely, we pessimise the 'my' variant too now:

        setup   => '@_ = 1..3;',
        code    => 'my ($x,$y,$z) = @_',

this gives 5% more instruction reads and 11% more conditional branches now.
But see the next commit, which will cheat for that particular construct.

8 years agoperldelta for fb10a8a78bba
Tony Cook [Mon, 17 Aug 2015 06:38:53 +0000 (16:38 +1000)]
perldelta for fb10a8a78bba

8 years ago[perl #125760] deprecate sys(read|write)(), send(), recv() on :utf8
Tony Cook [Mon, 17 Aug 2015 06:25:11 +0000 (16:25 +1000)]
[perl #125760] deprecate sys(read|write)(), send(), recv() on :utf8

8 years agoNo __attribute__((nonnull(...))) from NN.
Jarkko Hietaniemi [Sat, 8 Aug 2015 02:14:55 +0000 (22:14 -0400)]
No __attribute__((nonnull(...))) from NN.

8 years agoMath-BigInt is now 1.9997 on CPAN
Chris 'BinGOs' Williams [Thu, 13 Aug 2015 17:44:38 +0000 (18:44 +0100)]
Math-BigInt is now 1.9997 on CPAN

8 years agoavoid unnecessary noise from lib/h2xs.t
Tony Cook [Thu, 13 Aug 2015 05:40:32 +0000 (15:40 +1000)]
avoid unnecessary noise from lib/h2xs.t

8 years agoRequire civility; aspire to kindness.
Craig A. Berry [Thu, 6 Aug 2015 11:32:44 +0000 (06:32 -0500)]
Require civility; aspire to kindness.

Suggestion that we "aspire to kindness" from the ever-kind Tim Bunce.

Signed-off-by: Ricardo Signes <rjbs@cpan.org>
8 years agodont create *{"_<$filename"} globs for perl lang debugging of XSUBs
Daniel Dragan [Thu, 30 Jul 2015 06:00:07 +0000 (02:00 -0400)]
dont create *{"_<$filename"} globs for perl lang debugging of XSUBs

1st problem, *{"_<$filename"} globs aren't created for PP code unless
PERLDB_LINE || PERLDB_SAVESRC are on (see Perl_yylex ). Creating XSUBs
unconditionally created the *{"_<$filename"} globs for XSUB, even if PP
subs were not getting the debugging globs created. This is probably an
oversight, from commit b195d4879f which tried to deprecate using
the *{"_<$filename"} GVs for storing the originating filename of the CV
which was partially reverted 2 months later in commit 57843af05b with
CvFILE becoming a char * instead of GV *. To speed up XSUB registration
time, and decrease memory when not in Perl lang debugging mode dont create
the debugging globs for XSUBs unless in Perl lang debugging mode.

see also
http://www.nntp.perl.org/group/perl.perl5.porters/2000/06/msg13832.html

2nd problem, since the perl debugger can't step into C code, nor set
breakpoints in it, there is no reason to create *{"_<$filename"} globs
for .c files. Since someone maybe one day might try to implement that
feature, comment out the code instead of deleting it. This will slightly
reduce the size of perl binary, and speed up XSUB registration time, and
decrease memory usage when using the Perl debugger.

see also (no responses)
http://www.nntp.perl.org/group/perl.perl5.porters/2015/06/msg229014.html

perl has a number of core perma-XSUBs
(UNIVERSAL/PerlIO/DynaLoader/Internals/mro/misc const subs/etc). Each of
these previously got a "_<foo.c" glob. I counted 7 .c debugging globs on
my perl. This commit, before on WinXP, running threaded perl with
-e"system 'pause'" as a sample script, "Private Bytes" (all process
unique memory, IE not shared, not mmaped) was 488 KB, after this commit
it was 484 KB, which means that enough malloc memory was saved plus a
little bit of chance, to cross one 4 KB page of memory. IDK the exact
amount of saved memory is over or under 4KB.

8 years agocygwin 2.1.0 can test -r just fine, incl. under admin
Ivan Pozdeev [Mon, 3 Aug 2015 09:01:13 +0000 (12:01 +0300)]
cygwin 2.1.0 can test -r just fine, incl. under admin

8 years agoIncrement $VERSION for POSIX to 1.56
James E Keenan [Mon, 10 Aug 2015 22:53:14 +0000 (18:53 -0400)]
Increment $VERSION for POSIX to 1.56

8 years agoPorting/bisect-runner.pl: Generalize for EBCDIC
Karl Williamson [Sat, 16 May 2015 15:49:22 +0000 (09:49 -0600)]
Porting/bisect-runner.pl: Generalize for EBCDIC

This commit changes to not use hard-coded code point numbers so that it
also works on EBCDIC platforms.  An unintended consequence is that the
VT and \f spacing controls aren't considered a sign of binary.  That
seems correct to me.

8 years agoFix typo introduced in 0b81c0dda6
Steve Hay [Mon, 10 Aug 2015 12:55:16 +0000 (13:55 +0100)]
Fix typo introduced in 0b81c0dda6

8 years agoPod tweak for [rt.perl.org #125710].
Jarkko Hietaniemi [Sun, 9 Aug 2015 12:54:26 +0000 (08:54 -0400)]
Pod tweak for [rt.perl.org #125710].

8 years agoComment tweak related to [rt.perl.org #125710].
Jarkko Hietaniemi [Sun, 9 Aug 2015 02:59:52 +0000 (22:59 -0400)]
Comment tweak related to [rt.perl.org #125710].

8 years ago32-bit x86 ABI cannot do signaling nans [rt.perl.org #125710]
Jarkko Hietaniemi [Sun, 9 Aug 2015 02:47:33 +0000 (22:47 -0400)]
32-bit x86 ABI cannot do signaling nans [rt.perl.org #125710]

Sleuthed by Tony Cook.

The heuristics for the 'x86' part are a bit hacky and all my fault.

8 years agoFix test label.
Jarkko Hietaniemi [Wed, 5 Aug 2015 03:01:00 +0000 (23:01 -0400)]
Fix test label.

8 years agoComment tweaks.
Jarkko Hietaniemi [Wed, 5 Aug 2015 03:00:49 +0000 (23:00 -0400)]
Comment tweaks.