This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perl5.git
9 years agoUse LONG_DOUBLEKIND only if HAS_LONG_DOUBLE.
Jarkko Hietaniemi [Sat, 29 Nov 2014 16:12:24 +0000 (11:12 -0500)]
Use LONG_DOUBLEKIND only if HAS_LONG_DOUBLE.

9 years agoHP-UX 10.20 has pseudo-long-double which shouldn't be used.
Jarkko Hietaniemi [Fri, 28 Nov 2014 16:53:57 +0000 (11:53 -0500)]
HP-UX 10.20 has pseudo-long-double which shouldn't be used.

9 years agoUpdate libnet to CPAN version 3.04
Chris 'BinGOs' Williams [Sat, 29 Nov 2014 19:47:50 +0000 (19:47 +0000)]
Update libnet to CPAN version 3.04

  [DELTA]

3.04 2014-11-29

    - SNI is now only used for SSL connections if it is supported by
      IO::Socket::SSL (i.e. OpenSSL version >= 1).  (The previous release
      switched to using SNI by default, which caused some CPAN Testers
      failures.)  [Steffen Ullrich, PR#10]

9 years agoUpdate libnet to CPAN version 3.03
Chris 'BinGOs' Williams [Sat, 29 Nov 2014 15:21:12 +0000 (15:21 +0000)]
Update libnet to CPAN version 3.03

  [DELTA]

3.03 2014-11-28

    - Remodelled SSL support in Net::NNTP in the manner of Net::POP3 and
      Net::SMTP.  [Steffen Ullrich, PR#9]

    - Increased minimum requred IO::Socket::SSL version from 1.999 to 2.007 to
      fix data connection problems in Net::FTP.  [Steffen Ullrich, CPAN
      RT#100529]

    - Fixed a broken port() call in pasv_xfer()/pasv_xfer_unique() in Net::FTP.
      [Mario Preksavec, PR#8]

    - Increased minimum required Socket version from 1.3 to 2.016.  This may be
      required when those modules that can support IPv6 load IO::Socket::IP (on
      some OSes, at least).  It does not appear to be necessary if they load
      IO::Socket::INET6 or IO::Socket::INET instead, but this is not easy for
      the end-user to control so it is simpler to always insist on Socket 2.016
      or higher.  [CPAN RT#100020]

    - Fixed "Argument ... isn't numeric in subroutine entry" warnings when using
      older versions of Perl.  [CPAN RT#100020]

    - Added optional Changes testing (skipped unless AUTHOR_TESTING).

    - Reformatted Changes file as per CPAN::Changes::Spec.

9 years agoscalar($#foo) needs to propagate lvalue context
Father Chrysostomos [Sat, 29 Nov 2014 14:35:41 +0000 (06:35 -0800)]
scalar($#foo) needs to propagate lvalue context

$ ./perl -Ilib -le 'for($#foo) { $_ = 3 } print $#foo'
3
$ ./perl -Ilib -le 'for(scalar $#foo) { $_ = 3 } print $#foo'
-1

If I replace $#foo with $foo, I get the same results from both
one-liners.

In commit d408447cb6 (pre-5.16) I tried propagating lvalue context,
but I did not take into account things like \scalar @array, which
ended up being equivalent to \@array, instead of a returning a refer-
ence to a scalar holding the length of the array.  So I reverted it in
41b1a11c.  See bug #106288.

The $#foo example above, which I recently ran into, shows that we
really do need to propagate lvalue context.  (Come to think of it, it
is just a variant of the test I added in d408447cb6.)  But we need to
be careful what kind we propagate.  If scalar itself is in lvalue con-
text, then, regardless of the type, we need to apply ‘entersub’ lvalue
context to its argument.  Also, to preserve existing behaviour as much
as possible, this time scalar(...)= still dies.

9 years agodefine and use STATIC_ASSERT_STMT for compile-time invariants
Lukas Mai [Sat, 29 Nov 2014 11:17:05 +0000 (12:17 +0100)]
define and use STATIC_ASSERT_STMT for compile-time invariants

9 years agomake more use of NOT_REACHED
Lukas Mai [Sat, 29 Nov 2014 11:37:50 +0000 (12:37 +0100)]
make more use of NOT_REACHED

In particular, remove all instances of 'assert(0);'.

9 years ago[perl #123313] sub { f(); BEGIN{} } was void cx
Father Chrysostomos [Sat, 29 Nov 2014 14:04:38 +0000 (06:04 -0800)]
[perl #123313] sub { f(); BEGIN{} } was void cx

In v5.21.6-11-g34b5495 I accidentally put the last statement in a
block in void context when followed by a sub declaration.  scalarseq,
and not just scalar, needs to know about the extra ex-cop kid.

9 years agoop.c: Fix linux g++ compilation
Father Chrysostomos [Sat, 29 Nov 2014 05:33:03 +0000 (21:33 -0800)]
op.c: Fix linux g++ compilation

On darwin, passing a const char* to strchr just works.  On linux,
the compiler throws a tantrum.

9 years agofix off-by-one error in version check
Lukas Mai [Fri, 28 Nov 2014 23:07:38 +0000 (00:07 +0100)]
fix off-by-one error in version check

9 years agoOpcode.pm: wrap long verbatim pod line
Father Chrysostomos [Sat, 29 Nov 2014 04:14:53 +0000 (20:14 -0800)]
Opcode.pm: wrap long verbatim pod line

9 years agospeedup for SUPER::method() calls.
syber [Fri, 28 Nov 2014 18:22:25 +0000 (21:22 +0300)]
speedup for SUPER::method() calls.

In ck_method:
Scan for '/::. If found SUPER::, create OP_METHOD_SUPER op
with precomputed hash value for method name.

In B::*, added support for method_super

In pp_hot.c, pp_method_*:
S_method_common removed, code related to getting stash is
moved to S_opmethod_stash, other code is moved to
pp_method_* functions.

As a result, SUPER::func() calls speeded up by 50%.

9 years agoIncrease $XS::APItest::VERSION to 0.69
Father Chrysostomos [Sat, 29 Nov 2014 00:04:50 +0000 (16:04 -0800)]
Increase $XS::APItest::VERSION to 0.69

9 years agoFix newFOROP with PERL_OP_PARENT and no slab
Father Chrysostomos [Fri, 28 Nov 2014 22:50:33 +0000 (14:50 -0800)]
Fix newFOROP with PERL_OP_PARENT and no slab

It wasn’t updating the parent pointer after reallocating the op.

9 years agoperl5220delta: Future is fixed
Father Chrysostomos [Thu, 27 Nov 2014 22:48:32 +0000 (14:48 -0800)]
perl5220delta: Future is fixed

9 years agoext/Fcntl/Makefile.PL: Make S_IFMT unsigned
Tony Cook [Wed, 26 Nov 2014 22:50:47 +0000 (15:50 -0700)]
ext/Fcntl/Makefile.PL: Make S_IFMT unsigned

See <20141126223250.GS19835@mars.tony.develop-help.com>
S_IFMT on os390 has the upper bit set but Perl is expecting an unsigned,
so force it to be so.

9 years agoSpeed up newSViv()
Eric Herman [Fri, 28 Nov 2014 14:08:04 +0000 (15:08 +0100)]
Speed up newSViv()

newSViv() is not used a whole lot by the core. But it is frequently
used in XS modules. In a nutshell, it allocates a new EMPTY SV just to
call sv_setiv which calls sv_upgrade which in turn spends inordinate
amounts of time looking at the properties of the SV to make it an
SVt_IV. But the properties of that SV are always the same: a clean
slate! Therefore, inlining the very simple bits of sv_setiv that are
actually necessary gives a very tangible speed-up.

It's not very easy to benchmark with with a language-level one-liner
because newSViv() isn't too common in the core. Thus follow XS
micro-benchmarks:

Benchmark 1: Virtually no-op XS function.

  SV *
  echo_integer(int in)
    CODE:
      RETVAL = newSViv(in);
    OUTPUT: RETVAL

  $ dumbbench -i50 --pin-frequency -- ./perl -Ilib \
    -MXS::APItest -e 'XS::APItest::echo_integer($_) for 1..1000000'

Before: 3.2782e-01 seconds
After:  3.0530e-01 seconds

A small change, but considering the massive overhead of a function call,
quite surprisingly noticeable.

Benchmark 2: XS function that constructs multiple integer values.

SV *
echo_integer_array(int in)
  PREINIT:
    int i;
    AV *av;
  CODE:
    av = newAV();
    RETVAL = newRV_noinc((SV *)av);
    av_extend(av, in-1);
    for (i = 0; i < in; ++i)
      av_store(av, i, newSViv(i));
  OUTPUT: RETVAL

  $ dumbbench -i50 --pin-frequency -- ./perl -Ilib \
    -MXS::APItest -e 'XS::APItest::echo_integer_array(100) for 1..10000'

Before: 1.18363e-01 seconds
After:  0.92050e-01 seconds

While in the grand scheme of things, this might seem like a very small
optimization, there are many XS modules that actually generate a lot of
integer values, de-serializers being good examples.

9 years agoSpeed up assigning an IV to a previously cleared SV
Eric Herman [Fri, 28 Nov 2014 11:08:46 +0000 (12:08 +0100)]
Speed up assigning an IV to a previously cleared SV

This change simply avoids calling sv_upgrade (which will do a ton of
work to determine source and destination types) in a hot code path where
at that very location, we've already just done all the same leg work to
figure out source and destination types of the SV type conversion. In
this particularly common and simple variant (SVt_NULL to SVt_IV), it's
easy to do much better than sv_upgrade.

Micro-benchmark used to validate this:

  $ dumbbench -i50 --pin-frequency -- \
    ./perl -Ilib -e 'for my $x (1..1000){my @a = (1..2000);}'

Before:

  Rounded run time per iteration: 2.4311e-01 +/- 1.4e-04 (0.1%)

After:

  Rounded run time per iteration: 1.99354e-01 +/- 5.5e-05 (0.0%)

That's 18% faster. While the micro-benchmark is very heavy on exercising
this code path, it's a common code path. This is expected to have some
real-world impact. There are likely more, similar optimizations that
could have similar impact.

NB: A similar change to newSViv also speeds up newSViv significantly,
but newSViv is hardly used in the core. On the other hand, XS modules
exercise it a lot. The Sereal decoder would be significantly, positively
affected by doing a similar change there.

9 years agoRefactor bodyless-IV/NV hacks into define
Eric Herman [Fri, 28 Nov 2014 08:58:46 +0000 (09:58 +0100)]
Refactor bodyless-IV/NV hacks into define

This commit adds documentation of the bodyless-IV/NV hacks as well as
moving the offset calculation into a somewhat sensibly-named define
instead of cargo-culting the obscure logic in many different places.

9 years agoAdd Eric Herman to Perl AUTHORS
Steffen Mueller [Fri, 28 Nov 2014 09:02:22 +0000 (10:02 +0100)]
Add Eric Herman to Perl AUTHORS

9 years agoBump Dynloader version to satisfy porting/cmp_version.t
Chris 'BinGOs' Williams [Thu, 27 Nov 2014 22:44:37 +0000 (22:44 +0000)]
Bump Dynloader version to satisfy porting/cmp_version.t

9 years agoUpdate Encode to CPAN version 2.65
Chris 'BinGOs' Williams [Thu, 27 Nov 2014 22:27:32 +0000 (22:27 +0000)]
Update Encode to CPAN version 2.65

  [DELTA]

$Revision: 2.65 $ $Date: 2014/11/27 14:08:33 $
! Changes Encode.xs bin/enc2xs
  Applied 3 patches from jhi:
    0001-For-C-don-t-use-the-array-size-in-forward-declaratiotion
    0002-Unused-variables
    0003-1-needs-casting-to-STRLEN
  Message-Id: <54753674.6070909@iki.fi>

9 years agoHoist switch-local variables.
Jarkko Hietaniemi [Thu, 27 Nov 2014 16:52:56 +0000 (11:52 -0500)]
Hoist switch-local variables.

Additionally, svp was shadowed.

(clang -Wunreachable-code)

9 years agoswitch-local variables are a bad idea.
Jarkko Hietaniemi [Thu, 27 Nov 2014 16:46:27 +0000 (11:46 -0500)]
switch-local variables are a bad idea.

(another weirdness is that the mg and stash are not explicitly
used in the code, so the macros must be assuming their existence.)

(clang -Wunreachable-code)

9 years agoHP-UX dynaloading uses shl_t, not void ptr.
Jarkko Hietaniemi [Thu, 27 Nov 2014 15:32:13 +0000 (10:32 -0500)]
HP-UX dynaloading uses shl_t, not void ptr.

9 years agohv_store_ent() return value unused.
Jarkko Hietaniemi [Thu, 27 Nov 2014 15:26:48 +0000 (10:26 -0500)]
hv_store_ent() return value unused.

mg.c: In function 'Perl_magic_setlvref':
mg.c:2549:2: warning: value computed is not used [-Wunused-value]
pp.c: In function 'Perl_pp_refassign':
pp.c:6263:2: warning: value computed is not used [-Wunused-value]

9 years agoprintf type-matching.
Jarkko Hietaniemi [Thu, 27 Nov 2014 15:25:16 +0000 (10:25 -0500)]
printf type-matching.

9 years agoUpdate IO-Socket-IP to CPAN version 0.33
Chris 'BinGOs' Williams [Thu, 27 Nov 2014 13:58:44 +0000 (13:58 +0000)]
Update IO-Socket-IP to CPAN version 0.33

  [DELTA]

0.33    2014/11/21 16:17:39
        [BUGFIXES]
         * Use SOL_SOCKET/SO_ERROR sockopt rather than 2nd connect() error
           hoisting to detect nonblocking connect/failure when implementing
           Timeout (RT98976) (thanks Arthur Axel 'fREW' Schmidt)

9 years agoEnable POSIX::strtold() on Windows (GCC) USE_LONG_DOUBLE builds
Steve Hay [Thu, 27 Nov 2014 09:08:56 +0000 (09:08 +0000)]
Enable POSIX::strtold() on Windows (GCC) USE_LONG_DOUBLE builds

9 years agoModule-CoreList is at 5.20141120 on teh CPAN
Chris 'BinGOs' Williams [Thu, 27 Nov 2014 11:54:30 +0000 (11:54 +0000)]
Module-CoreList is at 5.20141120 on teh CPAN

9 years agoallow PERL_DISABLE_PMC to be defined from anywhere
Daniel Dragan [Sun, 23 Nov 2014 21:14:40 +0000 (16:14 -0500)]
allow PERL_DISABLE_PMC to be defined from anywhere

I enable PERL_DISABLE_PMC in a .h, not in CCFLAGS. CCFLAGS on Unix
typically has no -Ds in it, build options go into config.h, not
Config.pm's CCFLAGS. This change allows PERL_DISABLE_PMC option to pass
tests regardless of where it is defined. cpan/parent/t/parent-pmc.t is not
fixed by this patch.

9 years agoIf no cuserid(), s is unused.
Jarkko Hietaniemi [Thu, 27 Nov 2014 01:52:05 +0000 (20:52 -0500)]
If no cuserid(), s is unused.

9 years agoRevert "Remove -std=c89/-ansi if freebsd has "inline static" in <fenv.h>"
Jarkko Hietaniemi [Wed, 26 Nov 2014 22:15:51 +0000 (17:15 -0500)]
Revert "Remove -std=c89/-ansi if freebsd has "inline static" in <fenv.h>"

This reverts commit f5fdb0259d5e9470e8291544a8b209e202d36334.

(the theory is that 7ff69a2d made this unnecessary)

9 years agoUpdate Test-Simple to alpha 079
Chad Granum [Mon, 24 Nov 2014 04:57:26 +0000 (20:57 -0800)]
Update Test-Simple to alpha 079

9 years agoSuppress ‘-e syntax OK’ in concise.t
Father Chrysostomos [Wed, 26 Nov 2014 18:17:18 +0000 (10:17 -0800)]
Suppress ‘-e syntax OK’ in concise.t

On Windows, the output was including

# 490-e syntax OK
# :      $l->concise($level);

which does not match /(?^:\# 4\d\d: \s+ \$l->concise\(\$level\);)/,
hence the test failure.

9 years agoMake coresub.t faster by eschewing B::Deparse
Father Chrysostomos [Wed, 26 Nov 2014 06:41:27 +0000 (22:41 -0800)]
Make coresub.t faster by eschewing B::Deparse

Just use B directly to look at the op tree, instead of checking that
deparsed op trees are identical.

Before:

real 0m4.021s
user 0m3.668s
sys 0m0.191s

After:

real 0m0.388s
user 0m0.251s
sys 0m0.080s

9 years ago[PATCH] Do not use ccstdflags with the core extensions.
Jarkko Hietaniemi [Wed, 26 Nov 2014 19:29:05 +0000 (19:29 +0000)]
[PATCH] Do not use ccstdflags with the core extensions.

Signed-off-by: Chris 'BinGOs' Williams <chris@bingosnet.co.uk>
9 years agoPerlIO::encoding:fallback.t: White-space only
Karl Williamson [Wed, 26 Nov 2014 18:33:20 +0000 (11:33 -0700)]
PerlIO::encoding:fallback.t: White-space only

9 years agoPerlIO::encoding:fallback.t: Don't use undefined sub
Karl Williamson [Wed, 26 Nov 2014 18:31:56 +0000 (11:31 -0700)]
PerlIO::encoding:fallback.t: Don't use undefined sub

   skip_all isn't defined under Test::More.

9 years agoChange core to use is_invariant_string()
Karl Williamson [Tue, 25 Nov 2014 19:18:42 +0000 (12:18 -0700)]
Change core to use is_invariant_string()

is_ascii_string's name has misled me in the past; the new name is
clearer.

9 years agoBump ext/POSIX version to 1.48
Karl Williamson [Tue, 25 Nov 2014 19:20:42 +0000 (12:20 -0700)]
Bump ext/POSIX version to 1.48

9 years agoMake is_invariant_string()
Karl Williamson [Tue, 25 Nov 2014 19:12:54 +0000 (12:12 -0700)]
Make is_invariant_string()

This is a more accurately named synonym for is_ascii_string(), which is
retained.  The old name is misleading to someone programming for
non-ASCII platforms.

9 years agoImprove API pod of is_ascii_string
Karl Williamson [Tue, 25 Nov 2014 19:07:44 +0000 (12:07 -0700)]
Improve API pod of is_ascii_string

9 years agoMark is_ascii_string() as requiring looking at return value
Karl Williamson [Tue, 25 Nov 2014 19:00:48 +0000 (12:00 -0700)]
Mark is_ascii_string() as requiring looking at return value

There's no reason to call it otherwise; there are no side effects.

9 years ago[perl #123286] Lone C-style for in a block
Father Chrysostomos [Wed, 26 Nov 2014 02:08:13 +0000 (18:08 -0800)]
[perl #123286] Lone C-style for in a block

A block in perl usually consists of an enter/leave pair plus the con-
tents of the block:

  leave
     enter
     nextstate
     whatever

But if the contents of the block are simple enough to forego the
full block structure, a simple scope op is used, which is not
even executed:

  scope
    ex-nextstate
    whatever

If there is a real nextstate op anywhere in the block, it resets the
stack to whatever it was at block entry, based on the value on the
context stack placed there by the enter op.  That’s why we can never
have scope+nextstate (we have ex-nextstate, or a former nextstate op
that is not executed).

A for-loop (for(init; cond; cont) { ... }) executes the init section
first, and then an unstack op, which is like nextstate in that it
resets the stack based on what the context stack says is the base off-
set for this block.

If we have an unstack op, we can’t use scope, just as we can’t use it
with nextstate.  But we *were* nonetheless using scope in this case.

Hence, map { for(...;...;...) {...} } ... caused the for-loop to reset
the stack to the beginning of map’s own arguments.  So the for-loop
would stomp on them.

We can see the same bug with ‘for’ clobbering an outer list:

$ perl5.20.1 -le 'print 1..3, do{for(0;0;){}}, 4..6;'
0456

9 years agoCorrect OPf_SPECIAL/OP_UNSTACK comment
Father Chrysostomos [Wed, 26 Nov 2014 02:04:27 +0000 (18:04 -0800)]
Correct OPf_SPECIAL/OP_UNSTACK comment

I misread the code when I added it.

9 years agoUpdate release manager documents for producing .xz tarballs
Chris 'BinGOs' Williams [Tue, 25 Nov 2014 19:01:40 +0000 (19:01 +0000)]
Update release manager documents for producing .xz tarballs

9 years ago[perl #77860] \& proto should disallow sub calls
Father Chrysostomos [Tue, 25 Nov 2014 13:53:06 +0000 (05:53 -0800)]
[perl #77860] \& proto should disallow sub calls

It was checking to see whether its argument were an entersub op (&foo
is indeed an entersub) and then wrapping it in refgen (\).  But enter-
sub also covers &foo() and foo() and foo.  op_lvalue checks whether
the OPf_STACKED flag is set and only turns it into rv2cv if it is not.
(Only &foo lacks that flag.)  So I copied that logic into prototype
application.

9 years ago[perl #47363] \@ proto and parenthesised arrays
Father Chrysostomos [Tue, 25 Nov 2014 13:35:55 +0000 (05:35 -0800)]
[perl #47363] \@ proto and parenthesised arrays

The bug reported was that foo((@foo)) and foo+(@foo) pass a scalar
reference to a subroutine with a \@ prototype.

The scalar reference passed is the last element of @foo, or
&PL_sv_undef if @foo has no elements.  If the containing sub is called
in list context, however, the entire array is flattened and the proto-
typed sub gets a list of references longer that it is expecting.

$ ./perl -Ilib -e 'sub f ($\@) { warn "@_"; warn ${$_[1]} if ref $_[1] eq SCALAR } @_ = a..z; f(1, @_); f(1, (@_))'
1 ARRAY(0x7fe1220061f0) at -e line 1.
1 SCALAR(0x7fe1220353e0) at -e line 1.
z at -e line 1.
$ ./perl -Ilib -e '() = sub {sub f ($\@) { warn "@_"; warn ${$_[1]} if ref $_[1] eq SCALAR } @_ = a..z; f(1, @_); f(1, (@_)) }->()'
1 ARRAY(0x7f914a8362a8) at -e line 1.
1 SCALAR(0x7f914a806430) SCALAR(0x7f914a82f678) SCALAR(0x7f914a82f690) SCALAR(0x7f914a82f6c0) SCALAR(0x7f914a82f6a8) SCALAR(0x7f914a82f750) SCALAR(0x7f914a82f768) SCALAR(0x7f914a82f7f8) SCALAR(0x7f914a82f810) SCALAR(0x7f914a82f7e0) SCALAR(0x7f914a835cf0) SCALAR(0x7f914a835d08) SCALAR(0x7f914a835d20) SCALAR(0x7f914a835d38) SCALAR(0x7f914a835d50) SCALAR(0x7f914a835d68) SCALAR(0x7f914a835d80) SCALAR(0x7f914a835d98) SCALAR(0x7f914a835db0) SCALAR(0x7f914a835dc8) SCALAR(0x7f914a835de0) SCALAR(0x7f914a835df8) SCALAR(0x7f914a835e10) SCALAR(0x7f914a835e28) SCALAR(0x7f914a835e40) SCALAR(0x7f914a835e58) at -e line 1.
a at -e line 1.

The problem here is that \ applied to an array usually checks whether
the array was parenthesized.  If it was, it gets flattened.  The same
code paths were used for the implicit \ added by the prototype.  The
reason for the erratic behaviour based on the context of the enclos-
ing sub is that the refgen op had no context applied to it.  Usually
that means an op is at the end of a sub and should inherit the call-
ing context.

If we change the logic to remove the parentheses from the array before
applying the implicit \ then it behaves as expected.  Furthermore, we
end up with a srefgen op, which doesn‘t care about context, so we
don’t need to bother setting it.

9 years agoAllow \(&sub) for & proto
Father Chrysostomos [Tue, 25 Nov 2014 06:28:34 +0000 (22:28 -0800)]
Allow \(&sub) for & proto

I accidentally broke this in e41e9865.  Prior to this commit,
\&foo was becoming srefgen and \(&foo) was becoming refgen.
Srefgen is a slightly faster version of refgen that only han-
dles one item.  The easiest fix was to change the logic
in op.c:ck_spair so that \(&sub) with parens becomes srefgen.

9 years agoTreat nmake the same as dmake (expand 6544e9b1a)
Chris 'BinGOs' Williams [Tue, 25 Nov 2014 12:00:26 +0000 (12:00 +0000)]
Treat nmake the same as dmake (expand 6544e9b1a)

Already applied upstream

9 years agoRemove op_const_class; just use the name on the stack
syber [Mon, 24 Nov 2014 15:55:15 +0000 (18:55 +0300)]
Remove op_const_class; just use the name on the stack

Instead of storing the class name in the op_const_class field of the
METHOP in addition to pushing it on to the stack, just use the item on
the stack.  This also makes $class->method faster if $class is already
a shared hash string.

9 years agoRemove -std=c89/-ansi if freebsd has "inline static" in <fenv.h>
Jarkko Hietaniemi [Tue, 25 Nov 2014 01:39:18 +0000 (20:39 -0500)]
Remove -std=c89/-ansi if freebsd has "inline static" in <fenv.h>

Since -std=c89 (eq -ansi) simply isn't compatible with "inline static".

Based on a fix by TonyC.

9 years agoPrefer -std=c89 over -ansi.
Jarkko Hietaniemi [Tue, 25 Nov 2014 00:13:05 +0000 (19:13 -0500)]
Prefer -std=c89 over -ansi.

9 years agoRevert "Drop -std=c89."
Jarkko Hietaniemi [Mon, 24 Nov 2014 23:57:58 +0000 (18:57 -0500)]
Revert "Drop -std=c89."

This reverts commit 0d55a45a6f024919f13cbe70fc861f5eb6d757ee.

9 years agoPATCH [perl #123280] Turn off expected warnings in uni/fold.t
Karl Williamson [Mon, 24 Nov 2014 22:36:35 +0000 (15:36 -0700)]
PATCH [perl #123280] Turn off expected warnings in uni/fold.t

9 years agoDmake's -v means verbose not version
Chris 'BinGOs' Williams [Mon, 24 Nov 2014 22:33:43 +0000 (22:33 +0000)]
Dmake's -v means verbose not version

As Steve said in a500b25a5 there was a bug somewhere.

dmake -v was being run which translates to 'dmake -f Makefile all'
but with verbosity.

Oops.

Upstreamed to EUMM repository.

9 years agocharnames: More fix to work on EBCDIC.
Karl Williamson [Mon, 24 Nov 2014 18:22:00 +0000 (11:22 -0700)]
charnames: More fix to work on EBCDIC.

This adds a couple of fixes omitted from
27c3afbd6068ac83b49a11df3e33758ef059027e.

9 years agot/test.pl: Fix for non-ASCII platforms
Karl Williamson [Mon, 24 Nov 2014 18:19:03 +0000 (11:19 -0700)]
t/test.pl: Fix for non-ASCII platforms

9 years agopp_pack.c: Make pack('U', 0x41) eq 'A'
Karl Williamson [Mon, 24 Nov 2014 21:58:47 +0000 (14:58 -0700)]
pp_pack.c: Make pack('U', 0x41) eq 'A'

The 'U' pack/unpack format must be in terms of Unicode code points.

9 years agopp_pack.c: Add comment
Karl Williamson [Mon, 24 Nov 2014 21:57:02 +0000 (14:57 -0700)]
pp_pack.c: Add comment

9 years agoImprove EBCDIC skip msgs in t/uni
Karl Williamson [Wed, 12 Nov 2014 19:53:50 +0000 (12:53 -0700)]
Improve EBCDIC skip msgs in t/uni

Add more explanation as to why they are skipped

9 years agot/uni/case.pl: Improve test names.
Karl Williamson [Sat, 8 Nov 2014 18:22:36 +0000 (11:22 -0700)]
t/uni/case.pl: Improve test names.

This is clearer as to what is being tested and the desired result.

9 years agot/uni/case.pl: Use calculated test count
Karl Williamson [Sun, 9 Nov 2014 01:17:13 +0000 (18:17 -0700)]
t/uni/case.pl: Use calculated test count

This test file calculates the number of tests, but discards it in favor
of done_testing().  Since we've gone to the trouble of computing it, use
it.

9 years agolib/Unicode/UCD.t: Add missing arg to failure sprintf
Karl Williamson [Fri, 14 Nov 2014 17:08:35 +0000 (10:08 -0700)]
lib/Unicode/UCD.t: Add missing arg to failure sprintf

This wasn't spotted before because the test never failed.

9 years agoMake /[\N{}-\N{}]/ match Unicodely on EBCDIC
Karl Williamson [Mon, 24 Nov 2014 20:19:21 +0000 (13:19 -0700)]
Make /[\N{}-\N{}]/ match Unicodely on EBCDIC

This makes [\N{U+06}-\N{U+09}] match U+06, U+07, U+08, U+09 even on
EBCDIC platforms, allowing one to write portable ranges.  For 1047
EBCDIC this would match 0x2E, 0x2F, 0x16, and 0x05.

Thanks to Yaroslave Kuzmin for finding a bug in an earlier incarnation
of this patch.

9 years agotoke.c: Add comment
Karl Williamson [Thu, 13 Nov 2014 17:59:34 +0000 (10:59 -0700)]
toke.c: Add comment

9 years agoutf8.c: Shorten long constant names, and simplify
Karl Williamson [Mon, 24 Nov 2014 18:37:41 +0000 (11:37 -0700)]
utf8.c: Shorten long constant names, and simplify

The previous commit fixed a typo caused by it being hard to see the
differences in a long ALL_CAP name.  This uses #defines to type the long
name only once, and compile-time variables so the expression for the
length of strings only is specified once.

9 years agoutf8.c: Was taking sizeof() wrong thing
Karl Williamson [Mon, 24 Nov 2014 18:30:14 +0000 (11:30 -0700)]
utf8.c: Was taking sizeof() wrong thing

This was a typo due to the long name.  A future commit will make it
cleaner.  The sizeof() the wrong name evaluates to the right number on
ASCII platforms, but not EBCDIC.

9 years agoperlvar: Add info
Karl Williamson [Mon, 24 Nov 2014 17:41:23 +0000 (10:41 -0700)]
perlvar: Add info

9 years agocharnames: Generalize to work on non-ASCII platforms
Karl Williamson [Mon, 24 Nov 2014 17:34:27 +0000 (10:34 -0700)]
charnames: Generalize to work on non-ASCII platforms

This includes the tests.

The character names are now stored in native order.  This means that
pack('U') no longer works on non-ASCII platforms.  Use chr instead,
mostly, and pack('W*') for a sequence.

These changes required the 'encoding' pragma to no longer affect e.g.,
chr() outside its scope, which was recently done by
3e669301f0a6fa34269f0e1eaf1fbbd72cae498a.

9 years agocharnames: Don't return UTF-8 unless have to.
Karl Williamson [Mon, 24 Nov 2014 04:44:17 +0000 (21:44 -0700)]
charnames: Don't return UTF-8 unless have to.

A Latin-1 range character doesn't require UTF-8 to be represented.  Not
using UTF-8 speeds things up a lot.  This commit changes the return to
be UTF-8 only if necessary.  This could be because
 1) the character isn't representable except in UTF-8; or
 2) we are being called at runtime and the character isn't ASCII-range.
    The only way we can currently guarantee that an upper-Latin1
    character will be treated with Unicode rules is to make it UTF-8
    (the Unicode bug).  The compile-time code (in toke.c) knows how to
    properly deal with non-UTF-8 upper Latin1 range characters.

The utf8::downgrade introduced in this commit is temporary.  Future
commits will change things so that there is no need for it.

9 years agotoke.c: Ignore 'use encoding' on \N{}
Karl Williamson [Mon, 24 Nov 2014 04:50:41 +0000 (21:50 -0700)]
toke.c: Ignore 'use encoding' on \N{}

The encoding pragma converts from a specified encoding into Unicode.
\N{} already returns the Unicode form, so the encoding pragma
should not operate on them.  This commit ensures that.  The only reason
things have appeared to work prior to this commit is that \N{} has
generally returned its value in UTF-8, which 'encoding' knows enough to
not disturb.  However, a custom name translator installed in the program
need not return in UTF-8, so this is a bug that just hasn't yet been
exposed.

However, the next commit is about to change things so that a regular
\N{} only returns UTF-8 if it has to, so this bug would come up a lot
more often.  There is no need for adding a test case, because, without
this commit existing tests would fail in t/uni/greek.t.

9 years agolib/_charnames.pm: Change variable name
Karl Williamson [Sun, 23 Nov 2014 17:18:32 +0000 (10:18 -0700)]
lib/_charnames.pm: Change variable name

This lexical variable's use is about to change so it no longer will
always be in UTF-8 encoding.  So the name would become misleading.

9 years agocharnames: Nit in comments, pod
Karl Williamson [Sun, 23 Nov 2014 17:14:22 +0000 (10:14 -0700)]
charnames: Nit in comments, pod

9 years agocharnames: Bump version to 1.43
Karl Williamson [Sun, 23 Nov 2014 17:13:28 +0000 (10:13 -0700)]
charnames: Bump version to 1.43

9 years agotoke.c: Typo in comment
Karl Williamson [Sat, 22 Nov 2014 16:47:02 +0000 (09:47 -0700)]
toke.c: Typo in comment

9 years agoFix UTF8 lex sub names
Father Chrysostomos [Mon, 24 Nov 2014 07:41:45 +0000 (23:41 -0800)]
Fix UTF8 lex sub names

UTF8 lexical sub names were getting mangled, with extra junk on the end,
due to a precedence problem.

9 years agoperl5220delta: Function::Parameters update
Father Chrysostomos [Mon, 24 Nov 2014 07:04:30 +0000 (23:04 -0800)]
perl5220delta: Function::Parameters update

F:P has had an update, but now it fails due to the METHOP type
introduced in 5.21.5.

Patch at https://rt.cpan.org/Ticket/Display.html?id=100518

9 years agoperl5215delta.pod: typo
Father Chrysostomos [Mon, 24 Nov 2014 07:02:51 +0000 (23:02 -0800)]
perl5215delta.pod: typo

9 years agoop_class_sv removed for threaded perls op_class_targ removed for non-threaded perls
syber [Sat, 22 Nov 2014 23:30:32 +0000 (02:30 +0300)]
op_class_sv removed for threaded perls op_class_targ removed for non-threaded perls

9 years agoThis commit speeds up class method calls when class name is constant.
syber [Fri, 21 Nov 2014 17:21:00 +0000 (20:21 +0300)]
This commit speeds up class method calls when class name is constant.

I.e.
MyClass->method()
and
MyClass->$dynamic_method()

By about 30%.

It was done by saving class name (as shared COW string) in METHOP
and later checking it in method_common().

If it was set, then it fetches stash via gv_stashsv using precomputed
hash value instead of falling into a bunch of conditions and fetching
stash without hash value.

9 years agoremove a branch in SvIV_please_nomg
Daniel Dragan [Wed, 19 Nov 2014 04:08:25 +0000 (23:08 -0500)]
remove a branch in SvIV_please_nomg

On VC 2003 and GCC 4.6.3, this patch decreases from 3 branches to
2 branches that machine code that makes up SvIV_please_nomg. Functionality
should be identical as before. This is intended to make math functions like
pp_add faster. Due to complexity/my time, SvIV_please wasn't optimized.
"(SvNOK(sv) || SvPOK(sv)" was optimized to
"(SvFLAGS(sv) & (SVf_NOK|SVf_POK))" on GCC and VC 2003 before this patch,
so that change reenforces what the optimizer already did before.

.text section of miniperl.exe size in bytes
gcc 32b 4.6.3 -O2 before 0x10d154
gcc 32b 4.6.3 -O2 after  0x10d064
vc2003            before 0xa4odf
vc2003            after  0xa406f

9 years agoperldelta for d9bb50d52d1c
Tony Cook [Mon, 24 Nov 2014 03:40:55 +0000 (14:40 +1100)]
perldelta for d9bb50d52d1c

9 years agoimprove ParseXS RETVAL code gen
Daniel Dragan [Sat, 22 Nov 2014 22:11:20 +0000 (17:11 -0500)]
improve ParseXS RETVAL code gen

This patch avoids using ST(0) repeatedly in the OUTPUT section for RETVAL.
ST() include a read of global PL_stack_base. This read must be done between
every function call per C lang. XSRETURN also contains a PL_stack_base
read. sv_2mortal returns the incoming SV, the retval was previously ignored
and ST was used again. This patch reduced the number of ST references to
exactly 1, per RETVAL. The PL_stack_base reference in XSRETURN will be
optimized into the PL_stack_base reference in ST(0). Using the retval of
sv_2mortal allows the SV* to stay in a cheaper volatile register. In a
sequence of "RETVALSV = newSViv(RETVAL); RETVALSV = sv_2mortal(RETVALSV);
ST(0) = RETVALSV; XSRETURN(1);" RETVALSV never had to be saved around a
function call. Also ST(0) in a multi eval macro with different
function calls in it, will cause more PL_stack_base reads, so badly written
user supplied typemaps get optimized since a C auto that never had & done
on it is guarenteed to not change between function calls.

To produce cleaner C code, indenting cleanup is done, and if RETVAL is a
SV *, RETVALSV isn't created. Also if no additional boilerplate lines
like sv_2mortal are added, RETVALSV isn't created.

See [perl #123278] for details on machine code reductions that this patch
caused and also see
http://www.nntp.perl.org/group/perl.perl5.porters/2014/11/msg222342.html

9 years agoperl5220delta: Hook::LexWrap is fixed
Father Chrysostomos [Mon, 24 Nov 2014 03:25:00 +0000 (19:25 -0800)]
perl5220delta: Hook::LexWrap is fixed

9 years agoknown_pod_issues.dat: 2 more known mods
Father Chrysostomos [Mon, 24 Nov 2014 03:24:38 +0000 (19:24 -0800)]
known_pod_issues.dat: 2 more known mods

9 years agoAdd 2 more problematic mods to perl5220delta
Father Chrysostomos [Mon, 24 Nov 2014 01:44:44 +0000 (17:44 -0800)]
Add 2 more problematic mods to perl5220delta

9 years agoUpdate Test-Simple to Alpha 078
Chad Granum [Mon, 24 Nov 2014 00:24:50 +0000 (16:24 -0800)]
Update Test-Simple to Alpha 078

9 years ago[perl #123062] & proto: only sub{} and \&sub
Father Chrysostomos [Mon, 24 Nov 2014 00:58:45 +0000 (16:58 -0800)]
[perl #123062] & proto: only sub{} and \&sub

It was allowing \@array, \%hash, \($list, %of, @refs), undef, and
recently also \$scalar.  It should only allow sub{} and \&sub.

9 years agoConfigure syncup
H.Merijn Brand [Sun, 23 Nov 2014 18:45:33 +0000 (19:45 +0100)]
Configure syncup

Some of these changes also made it upstream to the dist svn repo.
OpenSource++

9 years agofix ext/B/t/optree_misc.t in unthreaded builds
David Mitchell [Sun, 23 Nov 2014 17:18:21 +0000 (17:18 +0000)]
fix ext/B/t/optree_misc.t in unthreaded builds

My fix to fix smokes broke something else.

(The people responsible for sacking the people who broke the builds, have
now been sacked.)

9 years agoAIX: gcc long doubles do not use -qlongdouble.
Jarkko Hietaniemi [Sun, 23 Nov 2014 14:59:25 +0000 (09:59 -0500)]
AIX: gcc long doubles do not use -qlongdouble.

9 years agofix recent Concise tests under PERL_UNICODE=''
David Mitchell [Sun, 23 Nov 2014 11:34:07 +0000 (11:34 +0000)]
fix recent Concise tests under PERL_UNICODE=''

Some smokers run with PERL_UNICODE set; this has the side effect of
making Concise display nextstate ops with open hints flags, e.g.

    nextstate(....) v:>,<,% ->8

where :... are the flags.

Concise 'golden samples' should have these flags set; they're stripped
from the expected output in the non-PERL_UNICODE case, rather than
being stripped from the actual output in the PERL_UNICODE case.

(It would probably make life easier if we did it the other way round.)

9 years agoRemove mysig* macros from vmsish.h.
Craig A. Berry [Sun, 23 Nov 2014 00:46:27 +0000 (18:46 -0600)]
Remove mysig* macros from vmsish.h.

We haven't defined overrides for these functions for a long time
so this is just dead code.

9 years agoUpdate Test-Simple to alpha 076
Chad Granum [Sat, 22 Nov 2014 19:58:05 +0000 (11:58 -0800)]
Update Test-Simple to alpha 076

For: RT #123277

9 years agoRevert part of 8629b8cee5
Steve Hay [Sat, 22 Nov 2014 17:55:17 +0000 (17:55 +0000)]
Revert part of 8629b8cee5

As BinGOs noted, all the EUMM testing should be happening in File::Temp
generated tempdirs under cpan/ExtUtils-MakeMaker/t/ so it handles being
run in parallel.

So the fact that lib/Big/(Dummy|Liar).pm are being created on Windows when
building/testing with GCC (but seemingly not MSVC++) is a bug somewhere.

9 years agodocument the postderef feature in feature.pm
Ricardo Signes [Sat, 22 Nov 2014 03:20:04 +0000 (22:20 -0500)]
document the postderef feature in feature.pm

9 years agoProtect ${^E_NCODING} from abuse
Father Chrysostomos [Fri, 21 Nov 2014 16:24:06 +0000 (08:24 -0800)]
Protect ${^E_NCODING} from abuse

When read, it is now always undef.  When set, it croaks as though
read-only except in the encoding package.  Hopefully that will dis-
suade anyone from depending on it.

9 years agoStorable: fixup pod wording
Jim Cromie [Fri, 6 Dec 2013 15:00:28 +0000 (08:00 -0700)]
Storable: fixup pod wording

fix grammar, eschew colloquial expression - s/turned into/converted to/

Increment Storable $VERSION.

For: RT #123271