This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perl5.git
9 years agoModule::CoreList - re-order so that Porting/corelist.pl runs ok
Steve Hay [Wed, 17 Sep 2014 07:48:26 +0000 (08:48 +0100)]
Module::CoreList - re-order so that Porting/corelist.pl runs ok

9 years agoperldelta - Add links for rt.perl.org bugs
Steve Hay [Wed, 17 Sep 2014 07:38:47 +0000 (08:38 +0100)]
perldelta - Add links for rt.perl.org bugs

9 years agoperldelta - Start updating modules
Steve Hay [Wed, 17 Sep 2014 07:33:31 +0000 (08:33 +0100)]
perldelta - Start updating modules

9 years agoRemove reference to obsolete threads version in Porting/cmpVERSION.pl
Steve Hay [Wed, 17 Sep 2014 07:26:26 +0000 (08:26 +0100)]
Remove reference to obsolete threads version in Porting/cmpVERSION.pl

9 years agoTeach Porting/cmpVERSION.pl about Scalar-List-Utils (broken by cb8c84586a)
Steve Hay [Wed, 17 Sep 2014 07:24:56 +0000 (08:24 +0100)]
Teach Porting/cmpVERSION.pl about Scalar-List-Utils (broken by cb8c84586a)

9 years agoonly produce diagnostic warnings in regen/regcomp.pl when STDERR is a terminal
Yves Orton [Wed, 17 Sep 2014 04:57:26 +0000 (06:57 +0200)]
only produce diagnostic warnings in regen/regcomp.pl when STDERR is a terminal

9 years agoPerl RT #122761 - split /\A/ should not behave like split /^/m
Yves Orton [Wed, 17 Sep 2014 02:36:57 +0000 (04:36 +0200)]
Perl RT #122761 - split /\A/ should not behave like split /^/m

Long ago a weird special case was hacked into split so that it
treated C<split /^/> as if it was C<split /^/m>. At the time this
was done by letting the split PP code inspect the pattern, and IFF
it matched "^\0" the special behavior was enabled (which also
bypasses using the regex engine for matching.)

Later on when we added pluggable regex engines and when we
encountered various counter-intuitive behaviors related to split
we changed who this worked so that the regex engine would
set flags appropriate for split to use. This meant that regex
plugins using totally different regex syntax could still enable
the optimisation. At the same time I modified how we detected
this pattern type by looking at the *compiled* regops, and not
the raw pattern. This had the side effect of making things like
C< split /(?:)^/ > also enable the optimisation.

Unfortunately this did not play nicely with the fact that /^/
produces an SBOL node, as does /\A/, but we definitely don't want
C<split /\A/> to behave like C<split /^/m>. In fact C<split /\A/>
should behave like a noop (which means there is room for a future
optimisation here if someone cares to implement it.)

In the discussion attached to the ticket I propose what I consider
to be a better fix, default split patterns to be compiled by default
with the /m modifier enabled. This patch does NOT do this. It is
instead the "simple" patch. This means that C<split /^/> behaves like
C<split /^/m> but C<split /^x/> does NOT behave like C<split /^x/m>
which I consider to be a bug which I will fix in a future patch.

9 years agochange NODE_ALIGN_FILL to set flags to 0
Yves Orton [Wed, 17 Sep 2014 02:10:35 +0000 (04:10 +0200)]
change NODE_ALIGN_FILL to set flags to 0

In 075abff3 Andy Lester set the flags field of regops
to default to 0xde. I find this really weird, and possibly dangerous,
as it seems to me reasonable to assume a new regop would have this
field set to 0, so that later on code can set it to something else
if necessary. (Which is what I wanted to do.)

Since nothing breaks if I set it to 0x0 and I find that to be a much
more natural default than 0xde (the prefix of 0xdeadbeef), I am
changing this to set it to 0.

9 years agoEliminate the duplicative regops BOL and EOL
Yves Orton [Tue, 16 Sep 2014 22:23:01 +0000 (00:23 +0200)]
Eliminate the duplicative regops BOL and EOL

See also perl5porters thread titled: "Perl MBOLism in regex engine"

In the perl 5.000 release (a0d0e21ea6ea90a22318550944fe6cb09ae10cda)
the BOL regop was split into two behaviours MBOL and SBOL, with SBOL
and BOL behaving identically. Similarly the EOL regop was split into
two behaviors SEOL and MEOL, with EOL and SEOL behaving identically.

This then resulted in various duplicative code related to flags and
case statements in various parts of the regex engine.

It appears that perhaps BOL and EOL were kept because they are the
type ("regkind") for SBOL/MBOL and SEOL/MEOL/EOS. Reworking regcomp.pl
to handle aliases for the type data so that SBOL/MBOL are of type
BOL, even though BOL == SBOL seems to cover that case without adding
to the confusion.

This means two regops, a regstate, and an internal regex flag can
be removed (and used for other things), and various logic relating
to them can be removed.

For the uninitiated, SBOL is /^/ and /\A/ (with or without /m) and
MBOL is /^/m. (I consider it a fail we have no way to say MBOL without
the /m modifier). Similarly SEOL is /$/ and MEOL is /$/m (there is
also a /\z/ which is EOS "end of string" with or without the /m).

9 years agoDo not test inf/nan if utterly broken.
Jarkko Hietaniemi [Tue, 16 Sep 2014 20:59:46 +0000 (16:59 -0400)]
Do not test inf/nan if utterly broken.

(The test for the brokenness was ... broken.)
(I think FC pointed this out some weeks ago.)

9 years ago[perl #122788] broken nan on win32
Jarkko Hietaniemi [Tue, 16 Sep 2014 21:20:54 +0000 (17:20 -0400)]
[perl #122788] broken nan on win32

Apparently VS 2003 smartly optimizes (HUGE_VAL-HUGE_VAL) into zero,
so using that for NaN was quite a disaster.  Let instead Win32 fall
thru to the __PL_nan_u option.  (HUGE_VAL for Inf is fine.)

9 years agoop.c: new is a keyword in C++
Father Chrysostomos [Tue, 16 Sep 2014 22:50:49 +0000 (15:50 -0700)]
op.c: new is a keyword in C++

9 years agoperldelta for 2872f9187
Father Chrysostomos [Tue, 16 Sep 2014 21:52:11 +0000 (14:52 -0700)]
perldelta for 2872f9187

9 years agoperldelta for a5f477419
Father Chrysostomos [Tue, 16 Sep 2014 21:51:17 +0000 (14:51 -0700)]
perldelta for a5f477419

9 years agoFix $DB::sub in DB::goto for lexical subs
Father Chrysostomos [Tue, 16 Sep 2014 21:49:03 +0000 (14:49 -0700)]
Fix $DB::sub in DB::goto for lexical subs

$ PERL5DB='sub DB::DB{}' ./perl -Ilib -XMfeature=:all -de '
    state sub f{};
    sub DB::goto { warn $DB::sub }
    $^P|=0x80;
    sub {goto &f}->()'
main::f at -e line 1.

There should not be a package name.  Lexical subs should be treated
like anonymous subs here; $DB::sub should contain a reference.

This bug was introduced recently, in ae77754ae.  Before that the
output was:

CODE(0x7fdbf102de58) at -e line 1.

Though before 9d8e4b9b3 it was:

Segmentation fault: 11

9 years agoMake "NEWS" an IGNORABLE file
Steve Hay [Tue, 16 Sep 2014 21:39:39 +0000 (22:39 +0100)]
Make "NEWS" an IGNORABLE file

Term-ANSIColor-4.03 added a NEWS file which wasn't pulled in by 5e64492f64,
probably in the belief that it was IGNORABLE. Now it is!

9 years agoAdd new Digest-SHA file missed by 207902b174, and note a CUSTOMIZED file
Steve Hay [Tue, 16 Sep 2014 21:39:04 +0000 (22:39 +0100)]
Add new Digest-SHA file missed by 207902b174, and note a CUSTOMIZED file

9 years agoMake sort bareword respect lexical subs
Father Chrysostomos [Tue, 16 Sep 2014 20:10:38 +0000 (13:10 -0700)]
Make sort bareword respect lexical subs

—something I completely missed when implementing them.

9 years agoUpdate ExtUtils-Manifest to CPAN version 1.68
Chris 'BinGOs' Williams [Tue, 16 Sep 2014 17:31:23 +0000 (18:31 +0100)]
Update ExtUtils-Manifest to CPAN version 1.68

  [DELTA]

1.68  Tue, Sep 16, 2014
  - Fix regression with manifind() and following symlinks

9 years agoMake ‘No comma allowed’ respect lex subs
Father Chrysostomos [Tue, 16 Sep 2014 16:43:31 +0000 (09:43 -0700)]
Make ‘No comma allowed’ respect lex subs

$ ./perl -lIlib -XMfeature=:all -e 'sub foo {} print foo,bar'
bar
$ ./perl -lIlib -XMfeature=:all -e 'state sub foo {} print foo,bar'
No comma allowed after filehandle at -e line 1.

This commit makes the latter behave like the former.

9 years agolexsub.t: To-do tests for sort lex_sub
Father Chrysostomos [Tue, 16 Sep 2014 12:47:17 +0000 (05:47 -0700)]
lexsub.t: To-do tests for sort lex_sub

9 years agotoke.c: Remove obsolete comment
Father Chrysostomos [Tue, 16 Sep 2014 12:32:35 +0000 (05:32 -0700)]
toke.c: Remove obsolete comment

345b37853 removed the associated parameter.

9 years agoUpdate ExtUtils-Install to CPAN version 2.04
Chris 'BinGOs' Williams [Tue, 16 Sep 2014 12:12:40 +0000 (13:12 +0100)]
Update ExtUtils-Install to CPAN version 2.04

  [DELTA]

2.04

- Cosmetic change as forgot to update version information in POD on last two
  releases

2.02

- Reverted change to pm_to_blib that causes write-only directory paths to
  be created

2.00

- Formal release to change META information and synchronise versioning

9 years agoSynchronise Maintainers.pl for Module-CoreList
Chris 'BinGOs' Williams [Tue, 16 Sep 2014 09:01:26 +0000 (10:01 +0100)]
Synchronise Maintainers.pl for Module-CoreList

9 years agoNote that one MakeMaker test is currently CUSTOMIZED
Steve Hay [Tue, 16 Sep 2014 08:24:11 +0000 (09:24 +0100)]
Note that one MakeMaker test is currently CUSTOMIZED

9 years agoRemove IGNORABLE files from ExtUtils-Install as per 8db6555210
Steve Hay [Tue, 16 Sep 2014 08:11:18 +0000 (09:11 +0100)]
Remove IGNORABLE files from ExtUtils-Install as per 8db6555210

(now that it's under cpan/, rather than dist/, since d393d7e5ec)

9 years agoUpgrade Archive-Tar from version 2.00 to 2.02
Steve Hay [Tue, 16 Sep 2014 08:00:39 +0000 (09:00 +0100)]
Upgrade Archive-Tar from version 2.00 to 2.02

9 years agoUpdate 5.20 release schedule: Plan for 5.20.2 in January
Steve Hay [Tue, 16 Sep 2014 07:53:07 +0000 (08:53 +0100)]
Update 5.20 release schedule: Plan for 5.20.2 in January

And add a missing development release engineer to the list.

9 years agoExclude lex sub package name from (caller $n)[3]
Father Chrysostomos [Tue, 16 Sep 2014 05:27:05 +0000 (22:27 -0700)]
Exclude lex sub package name from (caller $n)[3]

Commit ae77754ae caused it to start including the package name.  Pre-
viously, lexical subs were reported as ‘(unknown)’.

Now we have more expected output:

$ ./perl -Ilib -XMfeature=:all -e 'my sub x{warn +(caller 0)[3]} x'
x at -e line 1.

9 years agomg.c: Avoid reifying GV for undefined sig handler
Father Chrysostomos [Tue, 16 Sep 2014 03:39:22 +0000 (20:39 -0700)]
mg.c: Avoid reifying GV for undefined sig handler

9 years agoMake ‘SIG handler not defined’ UTF8- and null-safe
Father Chrysostomos [Tue, 16 Sep 2014 03:34:32 +0000 (20:34 -0700)]
Make ‘SIG handler not defined’ UTF8- and null-safe

9 years agoAvoid reifing GVs in gv.c:gv_try_downgrade
Father Chrysostomos [Tue, 16 Sep 2014 01:03:41 +0000 (18:03 -0700)]
Avoid reifing GVs in gv.c:gv_try_downgrade

I’m not sure that it’s even possible for a CV with a name hek to reach
this code path, but if that happens this avoids reifying the GV.

9 years agoFix compiler warnings
Father Chrysostomos [Tue, 16 Sep 2014 00:54:51 +0000 (17:54 -0700)]
Fix compiler warnings

See ticket #116735.

9 years agoperldelta for 7fcb4126
Father Chrysostomos [Mon, 15 Sep 2014 23:56:46 +0000 (16:56 -0700)]
perldelta for 7fcb4126

9 years agoAvoid reifying GVs when lex subs are used for overload
Father Chrysostomos [Mon, 15 Sep 2014 23:11:03 +0000 (16:11 -0700)]
Avoid reifying GVs when lex subs are used for overload

Takes more code, but I think the new code is clearer....

9 years agoStop undef &foo from temporarily anonymising
Father Chrysostomos [Mon, 15 Sep 2014 22:53:31 +0000 (15:53 -0700)]
Stop undef &foo from temporarily anonymising

Instead of setting aside the name, calling cv_undef, and then naming
the sub anew, just pass a flag to tell cv_undef not to unname it.

9 years agoAvoid reifying GV when lex stub is used as method
Father Chrysostomos [Mon, 15 Sep 2014 21:50:00 +0000 (14:50 -0700)]
Avoid reifying GV when lex stub is used as method

9 years agodelete/exists on array elements is discouraged, not deprecated
Ricardo Signes [Mon, 15 Sep 2014 23:03:36 +0000 (19:03 -0400)]
delete/exists on array elements is discouraged, not deprecated

For further discussion, see (among other things)
http://nntp.perl.org/group/perl.perl5.porters/218752

9 years agodocument how to graduate from experimental status
Ricardo Signes [Mon, 15 Sep 2014 22:19:41 +0000 (18:19 -0400)]
document how to graduate from experimental status

9 years agorelease schedule: Max M. will do December 2014
Ricardo Signes [Mon, 15 Sep 2014 22:19:28 +0000 (18:19 -0400)]
release schedule: Max M. will do December 2014

9 years agoFix assertion failure with undef &my_sub/&anon
Father Chrysostomos [Mon, 15 Sep 2014 21:28:22 +0000 (14:28 -0700)]
Fix assertion failure with undef &my_sub/&anon

$ ./perl -Ilib -le 'use experimental lexical_subs; my sub x; undef &x;'
Assertion failed: (isGV_with_GP(_gvname_hek)), function Perl_leave_scope, file scope.c, line 1035.
Abort trap: 6

pp_undef undefines a subroutine via cv_undef, which wipes out the
name, and then restores the name again afterwards.

For subs with GVs, it would call CvGV_set afterwards with the same gv.
But cv_undef could have freed the GV, if the CV held the only refer-
ence count.

I caused this for lexical subs a few commits ago in ae77754ae (because
CvGV will always return non-null; in fact the CvNAME_HEK code in
pp_undef is no longer exercised, but I will address that soon).

For anonymous subs it is older:

$ perl5.14.4 -e '$_ = sub{}; delete $::{__ANON__}; undef &$_; use Devel::Peek; Dump $_'
SV = IV(0x7fed9982f9c0) at 0x7fed9982f9d0
  REFCNT = 1
  FLAGS = (ROK)
  RV = 0x7fed9982f9e8
  SV = PVCV(0x7fed9982e290) at 0x7fed9982f9e8
    REFCNT = 2
    FLAGS = (PADMY,WEAKOUTSIDE,CVGV_RC)
    COMP_STASH = 0x7fed99806b68 "main"
    ROOT = 0x0
    GVGV::GV = 0x7fed9982fa48Assertion failed: (isGV_with_GP(_gvname_hek)), function Perl_do_gvgv_dump, file dump.c, line 1477.
Abort trap: 6

(Probably commit 803f2748.)

Presumably that could be made to crash in other ways than introspec-
tion, but it is much harder.

This commit fixes the problem by fiddling with reference counts.  But
this is only a temporary fix.  I think I plan to stop cv_undef from
removing the name (gv/hek) when called from pp_undef.

9 years agoPeek.t needs to know about the prev. change
Father Chrysostomos [Mon, 15 Sep 2014 16:35:50 +0000 (09:35 -0700)]
Peek.t needs to know about the prev. change

9 years agodump.c: Don’t dump GvFLAGS as part of GP
Father Chrysostomos [Mon, 15 Sep 2014 16:34:41 +0000 (09:34 -0700)]
dump.c: Don’t dump GvFLAGS as part of GP

The flags are not actually stored in the GP.  Dumping them as part of
it implies that they are shared between globs that share the same GP,
which is not the case.

9 years agoperldelta for f9d9e965
Father Chrysostomos [Mon, 15 Sep 2014 16:41:57 +0000 (09:41 -0700)]
perldelta for f9d9e965

9 years agoperldelta: Insert missing =item
Father Chrysostomos [Mon, 15 Sep 2014 16:42:13 +0000 (09:42 -0700)]
perldelta: Insert missing =item

9 years agoIncrease $Term::ReadLine::VERSION to 1.15
Father Chrysostomos [Mon, 15 Sep 2014 06:03:08 +0000 (23:03 -0700)]
Increase $Term::ReadLine::VERSION to 1.15

9 years agoTerm::ReadLine: Check $^O before -e
Father Chrysostomos [Mon, 15 Sep 2014 06:02:01 +0000 (23:02 -0700)]
Term::ReadLine: Check $^O before -e

Put faster checks first.  $^O is internal to perl, but -e has to go
out to the file system.

9 years agouniversal.c:croak_xs_usage: Don’t fetch context twice
Father Chrysostomos [Mon, 15 Sep 2014 13:22:30 +0000 (06:22 -0700)]
universal.c:croak_xs_usage: Don’t fetch context twice

9 years ago[Merge] CVs without GVs
Father Chrysostomos [Mon, 15 Sep 2014 13:20:16 +0000 (06:20 -0700)]
[Merge] CVs without GVs

Subroutines in packages no longer need typeglobs to live in.  Concep-
tually the typeglobs still exist, and will be reified as necessary.

(This was already the case with constant subs, which could be stored
in the stash as refs to constants, but now the stash can have sub
refs, too.)

Currently this optimisation is undone if a sub is exported or used as
a method.  Also, it does not apply to XSUBs.

Here is the full list of notable changes:

Internal:

• CvGV now reifies the GV if necessary.
• Lexical subs now have notional GVs, which are likewise rei-
  fied by CvGV.
• The new CVf_LEXICAL flag indicates that the package name should be
  dropped in error messages.

XS API:

• New cv_name function
• New cv_set_call_checker_flags function

Perl-visible changes:

• New B::safename function

9 years agoconcise-xs.t needs to know about B::safename
Father Chrysostomos [Sat, 13 Sep 2014 03:26:04 +0000 (20:26 -0700)]
concise-xs.t needs to know about B::safename

9 years agoTweak Peek.t again
Father Chrysostomos [Fri, 12 Sep 2014 21:14:07 +0000 (14:14 -0700)]
Tweak Peek.t again

9 years agodump.c: Missing comma from CVf_HASEVAL output
Father Chrysostomos [Fri, 12 Sep 2014 20:40:41 +0000 (13:40 -0700)]
dump.c: Missing comma from CVf_HASEVAL output

9 years agoTeach Deparse about coderefs in stashes
Father Chrysostomos [Fri, 12 Sep 2014 20:38:23 +0000 (13:38 -0700)]
Teach Deparse about coderefs in stashes

9 years agoIncrease $B::VERSION to 1.51
Father Chrysostomos [Fri, 12 Sep 2014 20:33:55 +0000 (13:33 -0700)]
Increase $B::VERSION to 1.51

9 years agoAdd safename() func to B
Father Chrysostomos [Fri, 12 Sep 2014 20:33:29 +0000 (13:33 -0700)]
Add safename() func to B

9 years agoRemove no-longer-used op.c:S_gv_ename
Father Chrysostomos [Fri, 12 Sep 2014 06:53:36 +0000 (23:53 -0700)]
Remove no-longer-used op.c:S_gv_ename

9 years agoTeach ck_entersub_args_proto about non-GV names
Father Chrysostomos [Fri, 12 Sep 2014 06:52:41 +0000 (23:52 -0700)]
Teach ck_entersub_args_proto about non-GV names

Now ck_subr no longer needs to vivify GVs:

$ ./miniperl -e 'sub foo{} BEGIN { warn $::{foo} } foo(); BEGIN { warn $::{foo} }'
CODE(0x7fc98282ad98) at -e line 1.
CODE(0x7fc98282ad98) at -e line 1.

Previously it was like this:

$ ./miniperl -e 'sub foo{} BEGIN { warn $::{foo} } foo(); BEGIN { warn $::{foo} }'
CODE(0x7f8ef082ad98) at -e line 1.
*main::foo at -e line 1.

9 years agoInline op.c:too_many_arguments_sv into its only caller
Father Chrysostomos [Fri, 12 Sep 2014 06:44:45 +0000 (23:44 -0700)]
Inline op.c:too_many_arguments_sv into its only caller

I’m about to change this code anyway, and it’s easier in one spot.

9 years agoInline op.c:too_few_arguments_sv into its only caller
Father Chrysostomos [Fri, 12 Sep 2014 06:42:45 +0000 (23:42 -0700)]
Inline op.c:too_few_arguments_sv into its only caller

I’m about to change this code anyway, and it’s easier in one spot.

9 years agoTeach dump.c about CVf_LEXICAL
Father Chrysostomos [Fri, 12 Sep 2014 05:49:44 +0000 (22:49 -0700)]
Teach dump.c about CVf_LEXICAL

9 years agoTeach dump.c about CVf_NAMED
Father Chrysostomos [Fri, 12 Sep 2014 05:49:18 +0000 (22:49 -0700)]
Teach dump.c about CVf_NAMED

I should have added this in perl 5.18.

9 years agoop.c:ck_subr: reify GVs based on call checker
Father Chrysostomos [Fri, 12 Sep 2014 00:59:11 +0000 (17:59 -0700)]
op.c:ck_subr: reify GVs based on call checker

Instead of faking up a GV to pass to the call checker if we have a
lexical sub, just get the GV from CvGV (since that will reify the GV,
even for lexical subs), unless the call checker has not specifically
requested GVs.

For now, we assume the default call checker cannot handle non-GV sub
names, as indeed it cannot.  An imminent commit will rectify that.

The code in scope.c was getting the name hek from the proto CV (stowed
in magic on the pad name) if the CV in the pad had lost it.  Now, the
proto CV can lose it at compile time via CvGV, so that does not work
anymore.  Instead, just get it from the GV.

9 years agoUse cv_name in pp_hot.c:sub_crush_depth
Father Chrysostomos [Fri, 12 Sep 2014 05:53:42 +0000 (22:53 -0700)]
Use cv_name in pp_hot.c:sub_crush_depth

The next commit will allow lexical subs with GVs to reach this code
path, so use cv_name, since it knows how to handle those.

9 years agoAdd cv_set_call_checker_flags
Father Chrysostomos [Thu, 11 Sep 2014 20:37:15 +0000 (13:37 -0700)]
Add cv_set_call_checker_flags

This is like cv_set_call_checker, except that it allows the caller to
decide whether the call checker needs a GV.

Currently the GV flag is recorded, but ck_subr does not do anything
with it yet.

9 years agopad.c: Avoid struct name followed by colon
Father Chrysostomos [Thu, 11 Sep 2014 05:06:10 +0000 (22:06 -0700)]
pad.c: Avoid struct name followed by colon

Some old clang++ versions have trouble with this.  See ticket #112786.

9 years agopad.c:cv_name: Reword docs for future extensibility
Father Chrysostomos [Thu, 11 Sep 2014 05:01:15 +0000 (22:01 -0700)]
pad.c:cv_name: Reword docs for future extensibility

9 years agoAvoid reifying GVs in rv2cv
Father Chrysostomos [Thu, 11 Sep 2014 03:29:19 +0000 (20:29 -0700)]
Avoid reifying GVs in rv2cv

\&foo no longer reifies GVs in the stash:

$ ./miniperl -e 'sub foo{} warn $::{foo}; \&foo; warn $::{foo}'
CODE(0x7fab6282ad98) at -e line 1.
CODE(0x7fab6282ad98) at -e line 1.

Sub calls still reify them though, because of the way ck_subr cur-
rently works.

Constant proxies are still upgraded to full GVs for now, just to mini-
mise the churn per patch.

This makes it possible for OP_GVs to point to things other than GVs,
and these things are stored in the pad under threads.  Hence, pad_tidy
could turn on PADTMP, and then IS_PADGV becomes true when it is
upgraded to a glob, so refgen will fail assertions.  There is actually
no need to turn on PADTMP in pad_tidy, since it will already be on for
op targets.  (We need to get rid of IS_PADGV one of these days.  It
doesn’t actually do anything.)

9 years agoop.c: ck_rvconst: Inline the noexpand var
Father Chrysostomos [Wed, 10 Sep 2014 21:23:53 +0000 (14:23 -0700)]
op.c: ck_rvconst: Inline the noexpand var

It is only used once now, and its name is about to become confusing,
as GV_NOEXPAND will be used for all CVs.

9 years agoIncrease $Attribute::Handlers::VERSION to 0.97
Father Chrysostomos [Sun, 7 Sep 2014 05:59:36 +0000 (22:59 -0700)]
Increase $Attribute::Handlers::VERSION to 0.97

9 years agoTweak Peek.t
Father Chrysostomos [Sat, 6 Sep 2014 23:22:53 +0000 (16:22 -0700)]
Tweak Peek.t

beab08741 introduced XSUB constants, but the code it added to
newATTRSUB does not set CvSTASH if there is already a CV stub.  It
does set it if there is no sub there at all (because it goes through
newCONSTSUB).

Recent changes have made constant declarations like ‘sub foo(){}’
put just a constant reference in the stash if possible, the way con-
stant.pm does.  When this gets upgraded to a typeglob, the CV is rei-
fied via newCONSTSUB, so it gets a CvSTASH pointer.

CvSTASH on a constant sub really makes no difference in practice.
It’s mostly cosmetic.

This exercises the two code paths with the oldest perl installa-
tion I have:

$ /opt/bin/perl5.8.8 -MDevel::Peek -e 'BEGIN{\&foo} sub foo(){3} Dump \&foo'
SV = RV(0x9baa18) at 0x98d580
  REFCNT = 1
  FLAGS = (TEMP,ROK)
  RV = 0x9b7398
  SV = PVCV(0x9b4810) at 0x9b7398
    REFCNT = 2
    FLAGS = (POK,pPOK,CONST)
    IV = 0
    NV = 0
    PROTOTYPE = ""
    COMP_STASH = 0x98d4a8 "main" <----------
    ROOT = 0x0
    XSUB = 0x5bb44
    XSUBANY = 10018864
    GVGV::GV = 0x98df7c "main" :: "foo"
    FILE = "-e"
    DEPTH = 0
    FLAGS = 0x200
    OUTSIDE_SEQ = 96
    PADLIST = 0x98e228
    PADNAME = 0x98e24c(0x0) PAD = 0x98e264(0x22d560)
    OUTSIDE = 0x98df34 (UNIQUE)
$ /opt/bin/perl5.8.8 -MDevel::Peek -e 'sub foo(){3} Dump \&foo'
SV = RV(0xc11018) at 0xbe3b80
  REFCNT = 1
  FLAGS = (TEMP,ROK)
  RV = 0xbe4570
  SV = PVCV(0xc0ae10) at 0xbe4570
    REFCNT = 2
    FLAGS = (POK,pPOK,CONST)
    IV = 0
    NV = 0
    PROTOTYPE = ""
    COMP_STASH = 0x0 <--------------------------
    ROOT = 0x0
    XSUB = 0x5bb44
    XSUBANY = 12469628
    GVGV::GV = 0xbe3c40 "main" :: "foo"
    FILE = "-e"
    DEPTH = 0
    FLAGS = 0x200
    OUTSIDE_SEQ = 0
    PADLIST = 0x0
    OUTSIDE = 0x0 (null)

9 years agoFix-ups for Attribute::Handlers
Father Chrysostomos [Sat, 6 Sep 2014 20:09:05 +0000 (13:09 -0700)]
Fix-ups for Attribute::Handlers

It was making unreliable assumptions about the contents of stashes.

9 years agosv.h: Expand comment about potential SVf_UTF8 conflict
Father Chrysostomos [Mon, 1 Sep 2014 01:05:49 +0000 (18:05 -0700)]
sv.h: Expand comment about potential SVf_UTF8 conflict

9 years agoAvoid creating GVs when subs are declared
Father Chrysostomos [Mon, 1 Sep 2014 03:13:21 +0000 (20:13 -0700)]
Avoid creating GVs when subs are declared

This patch changes ‘sub foo {...}’ declarations to store subroutine
references in the stash, to save memory.

Typeglobs still notionally exist.  Accessing CvGV(cv) will reify them.
Hence, currently the savings are lost when a sub call is compiled.

$ ./miniperl -e 'sub foo{} BEGIN { warn $::{foo} } foo(); BEGIN { warn $::{foo} }'
CODE(0x7f8ef082ad98) at -e line 1.
*main::foo at -e line 1.

This optimisation is skipped if the subroutine declaration contains a
package separator.

Concerning the changes in caller.t, this code:

    sub foo { print +(caller(0))[3],"\n" }
    my $fooref = delete $::{foo};
    $fooref -> ();

used to crash in 5.7.3 or thereabouts.  It was fixed by 16658 (aka
07b8c804e8) to produce ‘(unknown)’ instead.  Then in 5.13.3 it was
changed (by 803f274) to produce ‘main::__ANON__’ instead.  So the
tests are really checking that we don’t get a crash.  I think it is
acceptable that it has now changed to ‘main::foo’.

9 years agoRemove bogus gv-handling code from toke.c
Father Chrysostomos [Sun, 7 Sep 2014 05:51:15 +0000 (22:51 -0700)]
Remove bogus gv-handling code from toke.c

This code was added by 211a4342c, which was actually restoring some
code that f74617600 removed.

Its purpose was to expand a proxy to a real GV after we found out that
we really are going to compile a sub call op.

This code is actually unreachable at present (sub call lookup via
rv2cv ops expands stub declarations, but not references to constants;
references to constants are not compiled to sub calls), which is a
good thing, because (1) it does not take UTF8 names into account and
(2) it does not work with rv2cv hooks or our subs, because it assumes
that the value of PL_tokenbuf is normative and can be used to
reify a glob.

9 years agoFor lexical subs, reify CvGV from CvSTASH and CvNAME_HEK
Father Chrysostomos [Fri, 29 Aug 2014 01:26:36 +0000 (18:26 -0700)]
For lexical subs, reify CvGV from CvSTASH and CvNAME_HEK

From now on, the presence of a name hek implies a GV.  Any access to
CvGV will cause that implicit GV to be reified.

9 years agoIncrease $XS::APItest::VERSION to 0.64
Father Chrysostomos [Fri, 29 Aug 2014 00:40:23 +0000 (17:40 -0700)]
Increase $XS::APItest::VERSION to 0.64

9 years agoTest cv_name
Father Chrysostomos [Fri, 29 Aug 2014 00:39:48 +0000 (17:39 -0700)]
Test cv_name

9 years agopad.c: Document cv_name
Father Chrysostomos [Thu, 28 Aug 2014 23:03:22 +0000 (16:03 -0700)]
pad.c: Document cv_name

9 years agosv_cathek
Father Chrysostomos [Thu, 28 Aug 2014 22:59:05 +0000 (15:59 -0700)]
sv_cathek

This macro, intended for internal use, simplifies the code in
a couple of places.

9 years agocv_name
Father Chrysostomos [Thu, 28 Aug 2014 22:56:30 +0000 (15:56 -0700)]
cv_name

An API function for getting the name of a CV.  Docs to follow.

9 years agoTurn on CVf_LEXICAL for lexical subs
Father Chrysostomos [Fri, 29 Aug 2014 00:37:55 +0000 (17:37 -0700)]
Turn on CVf_LEXICAL for lexical subs

This flag will signify that lexical subs should not have package names
associated with them in error messages, etc.

9 years agoAdd CVf_LEXICAL flag
Father Chrysostomos [Thu, 28 Aug 2014 19:55:56 +0000 (12:55 -0700)]
Add CVf_LEXICAL flag

Lexical subs will use this instead of CvNAMED to indicate that the
name should not include the package.

9 years agoperldelta for d205f0c
Father Chrysostomos [Mon, 15 Sep 2014 01:16:36 +0000 (18:16 -0700)]
perldelta for d205f0c

9 years agoClone lex sub names properly
Father Chrysostomos [Mon, 15 Sep 2014 00:50:11 +0000 (17:50 -0700)]
Clone lex sub names properly

I used share_hek_hek, which is wrong.  HEKs are not shared between
interpreters, so it must be hek_dup.

9 years agoConsistent spaces after dots in perlsub
Father Chrysostomos [Sun, 14 Sep 2014 23:04:17 +0000 (16:04 -0700)]
Consistent spaces after dots in perlsub

9 years agoperldelta for 6678689 and 56cd2ef
Father Chrysostomos [Sun, 14 Sep 2014 19:51:59 +0000 (12:51 -0700)]
perldelta for 6678689 and 56cd2ef

9 years agoperldelta for b4fa55d and 0ddd4a5
Father Chrysostomos [Sun, 14 Sep 2014 19:50:04 +0000 (12:50 -0700)]
perldelta for b4fa55d and 0ddd4a5

9 years agoperldelta for 2c1f00b/#122747
Father Chrysostomos [Sun, 14 Sep 2014 19:43:20 +0000 (12:43 -0700)]
perldelta for 2c1f00b/#122747

9 years agoperldelta for c4c61c6
Father Chrysostomos [Sun, 14 Sep 2014 19:24:46 +0000 (12:24 -0700)]
perldelta for c4c61c6

9 years agoperldelta for 1542cb4/#122728
Father Chrysostomos [Sun, 14 Sep 2014 18:23:52 +0000 (11:23 -0700)]
perldelta for 1542cb4/#122728

9 years agoperldelta for cfc7ef1
Father Chrysostomos [Sun, 14 Sep 2014 15:02:10 +0000 (08:02 -0700)]
perldelta for cfc7ef1

9 years agoDarwin: set ld to 'cc' if $cc is 'cc' or empty, $cc otherwise.
Jarkko Hietaniemi [Sun, 14 Sep 2014 17:28:00 +0000 (13:28 -0400)]
Darwin: set ld to 'cc' if $cc is 'cc' or empty, $cc otherwise.

9 years agoadd test for rt122747
Yves Orton [Sun, 14 Sep 2014 16:55:12 +0000 (18:55 +0200)]
add test for rt122747

9 years agoshare_hek_hek "return value" is unused here.
Jarkko Hietaniemi [Sun, 14 Sep 2014 13:47:43 +0000 (09:47 -0400)]
share_hek_hek "return value" is unused here.

(noticed by gcc 4.9)

9 years agoDarwin: if cc is explicitly gcc/g++, use it also as ld.
Jarkko Hietaniemi [Sun, 14 Sep 2014 02:06:13 +0000 (22:06 -0400)]
Darwin: if cc is explicitly gcc/g++, use it also as ld.

9 years agoDefine Perl_isfinite only if not already defined.
Jarkko Hietaniemi [Sun, 14 Sep 2014 01:13:10 +0000 (21:13 -0400)]
Define Perl_isfinite only if not already defined.

9 years agoperldelta: Entry for [perl #122655].
Karl Williamson [Sun, 14 Sep 2014 15:17:41 +0000 (09:17 -0600)]
perldelta: Entry for [perl #122655].

5.20 regression: '"X" !~ /[x]/i'

It looks like this patch, included in 5.20.1, did not get a perldelta
entry for that release.

9 years agoperldelta: Note bug fix to suppress repeated warnings
Karl Williamson [Sun, 14 Sep 2014 14:53:54 +0000 (08:53 -0600)]
perldelta: Note bug fix to suppress repeated warnings

9 years agoperldelta: Mention -T -B changes
Karl Williamson [Sun, 14 Sep 2014 14:37:37 +0000 (08:37 -0600)]
perldelta: Mention -T -B changes

9 years agoCopy perl5201delta into blead
Steve Hay [Sun, 14 Sep 2014 14:20:36 +0000 (15:20 +0100)]
Copy perl5201delta into blead