This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perl5.git
9 years agoDocument sub inlining changes
Father Chrysostomos [Thu, 13 Nov 2014 06:29:27 +0000 (22:29 -0800)]
Document sub inlining changes

Most of the changes do not need to be documented, because the previous
behaviour did not match the documentation or was just plain buggy.

9 years agopad.c:cv_clone_pad: Avoid copying sv
Father Chrysostomos [Tue, 4 Nov 2014 21:25:49 +0000 (13:25 -0800)]
pad.c:cv_clone_pad: Avoid copying sv

When we capture the lexical variable in order to make sub () {$x}
constant, we don’t have to copy it if it is not modified or referenced
elsewhere.

9 years agoAccount for state vars when const-izing sub(){$x}
Father Chrysostomos [Tue, 4 Nov 2014 06:28:08 +0000 (22:28 -0800)]
Account for state vars when const-izing sub(){$x}

If the only lvalue use of a lexical ‘my’ variable is its declaration,
then it is fine to turn a sub that closes over it into a constant.

But with state variables we have to be a little more careful.

This is fine:

    state $x = something();
    sub () { $x }

because the variable is only assigned to once.  But this modifies the
same variable every time the enclosing sub is called:

    state $x++;
    sub () { $x }

So that closure must remain a closure, and not become a constant.

(However, for a simple lexical scalar in the sub like that, we still
make it a constant, but deprecate the usage.)

9 years agoAccount for string eval when const-izing sub(){$x}
Father Chrysostomos [Tue, 4 Nov 2014 06:18:11 +0000 (22:18 -0800)]
Account for string eval when const-izing sub(){$x}

If we have a string eval in the same scope as the variable, it is
potentially in value context.

9 years agoMake op.c:op_const_sv static
Father Chrysostomos [Tue, 4 Nov 2014 01:56:11 +0000 (17:56 -0800)]
Make op.c:op_const_sv static

It is no longer called from any other file.

9 years agoInline op_const_sv into cv_clone
Father Chrysostomos [Tue, 4 Nov 2014 01:53:01 +0000 (17:53 -0800)]
Inline op_const_sv into cv_clone

op_const_sv is actually two functions in one.  This particular calling
convention (CvCONST) was used only by cv_clone.

Half the code was not even necessary for cv_clone’s use (the other
half only for its use), so this reduces the total number of lines.

9 years agoMake sub () { 0; 3 } inlinable once more
Father Chrysostomos [Mon, 3 Nov 2014 06:24:32 +0000 (22:24 -0800)]
Make sub () { 0; 3 } inlinable once more

It probably stopped being inlinable in commit beab0874143b.

Following op_next pointers to see whether a sub’s execution chain con-
sists of a constant followed by sub exit does not make sense if the
op_next pointers have not been set up yet.

So call LINKLIST earlier, so that we can merge the two calls to
op_const_sv in newATTRSUB (no need to search for constants twice).
That will allow sub () { 0; 3 } to be inlined once more, as it was in
perl 5.005 (I checked) and probably in 5.6, too (I didn’t check).

This also allows us to remove initial the OP_LINESEQ check, which
was added to help this function into the block when we have no
op_next pointers.

op_const_sv is now called only before the peephole optimiser and
finalize_op, which removes the need for the special explicit return
check (it hasn’t been optimised out of the execution chain yet) and
the need to account for constants that have been relocated to the pad
by finalize_op.

9 years agoAllow sub():method{CONSTANT} to be inlined
Father Chrysostomos [Mon, 3 Nov 2014 05:54:22 +0000 (21:54 -0800)]
Allow sub():method{CONSTANT} to be inlined

This brings non-closure subs into conformity with closures.

9 years agoFirst arg to op_const_sv is never null
Father Chrysostomos [Mon, 3 Nov 2014 05:34:23 +0000 (21:34 -0800)]
First arg to op_const_sv is never null

9 years agoRemove SvREADONLY_on from op.c:op_const_sv
Father Chrysostomos [Mon, 3 Nov 2014 00:50:40 +0000 (16:50 -0800)]
Remove SvREADONLY_on from op.c:op_const_sv

If we turn on the padtmp flag, then this this SV will never be seen in
lvalue context, so whether it is read-only is irrelevant.  Don’t even
bother making it so.

9 years agoop.c:Start the search for const vars at CvSTART
Father Chrysostomos [Mon, 3 Nov 2014 00:46:57 +0000 (16:46 -0800)]
op.c:Start the search for const vars at CvSTART

When we search an op tree to see whether it could become a constant
closure, we search the op execution chain, but we don’t necessarily
start at the beginning.  We start at the outermost op of the first
statement’s contents.  That means that for sub {$a+$b} we begin the
search at the + (add), even though the full execution chain is next-
state, gvsv, gvsv, add, leavesub.

It was this oddity that led to bug #63540.  Originally (before
beab0874143b), the search through the op chain started at CvSTART
(the start of the execution chain), but was accidentally changed
in beab0874143b.  (That was also when sub(){return 2} stopped
being inlined.)

Changing this back to the way it used to be allows use to remove the
check to see whether a null op has kids, which was added to handle op
trees like

 b leavesub
 -   lineseq
 1     nextstate
 -     null ->9
 3       and
 2         padsv
 8         leave
 4           enter
 5           nextstate
 7           die
 6             pushmark
 9     nextstate
 a     const

which is the result of sub { if($x){ die }; 0 }.

If we begin the search at the null op, and if nulls are skipped, we
end up missing the entire ‘if’ block and seeing just null, nextstate,
const, leavesub, which looks constant.

9 years agoHandle multiple closures in sub(){$x} const-izing
Father Chrysostomos [Mon, 3 Nov 2014 00:31:27 +0000 (16:31 -0800)]
Handle multiple closures in sub(){$x} const-izing

Till now, we were checking the reference count of the variable that we
have just closed over, to see whether the newly-cloned sub can become
a constant.  A reference count of 2 would indicate that only the outer
pad and the pad of the newly-cloned sub held references.

Recent commits also checked whether the variable is used in lvalue
context in the outer sub in places other than its declaration.

This is insufficient to detect cases like:

    my $x = 43;
    my $const_closure = sub () { $x };
    my $other_closure = sub {$x++};

Although it does work if the $other_closure comes first (because it
holds a refcount by the time the $const_closure is created).

Extending the check for lvalue uses to inner subs as well (the changes
this commit makes to op_lvalue_flags) fixes that issue.  It does not
allows cases like

    my $x = 43;
    my $other_closure = sub { $x };
    my $const_closure = sub () { $x };

to create a constant, because the reference count check still prevents
it.  I tried removing the reference count check, but it fails for
cases like \(my $x = 1), which allows $x to be referenced elsewhere,
even though the only lvalue use of it is its declaration.

As with the commits leading up to this, we allow a simple sub(){$x} to
create constants erroneously where it would have done so before, but
with a deprecation warning.

The deprecation warning had to be moved, because it could trigger even
in those cases where the refcount check fails and we don’t create a
constant, which is just wrong.

This commit does not account for string eval within the scope of
the variable.

9 years agoconst-optree.t: Correct comment
Father Chrysostomos [Sun, 2 Nov 2014 14:20:09 +0000 (06:20 -0800)]
const-optree.t: Correct comment

9 years agoDon’t inline sub(){ 0; return $x }
Father Chrysostomos [Sun, 2 Nov 2014 14:02:18 +0000 (06:02 -0800)]
Don’t inline sub(){ 0; return $x }

If return occurs at the end of a sub, it is optimised out of the
execution, chain, so we have to look at the op tree structure to
detect it.

9 years agoDon’t inline sub(){ 0; return $x; ... }
Father Chrysostomos [Sun, 2 Nov 2014 05:17:39 +0000 (22:17 -0700)]
Don’t inline sub(){ 0; return $x; ... }

We document that explicit return prevents subs from being inlined.
But if that explicit return comes after a statement optimised away,
then it does not prevent inlining.

Originally, explicit return did not prevent inlining, and the way
constant subs were detected was to search through the op chain in
execution order, looking for padsv followed by return or leavesub.
Later, things were accidentally changed, such that the search began,
not at the beginning of the execution chain, but at the outer-
most op of the first statement’s contents.  That means that, with
sub () { $a + $b }, we begin the search at the + (add), even though
the execution order is nextstate, gvsv, gvsv, add, leavesub.  So for
sub () { return $x } we begin the search at return, and miss the padsv
that precedes it.

Even though it was accidental that ‘return’ inlining was broken, it
ended up becoming a documented feature, and has been so for over a
decade.  So I am just making things consistent with that.

This commit only affects those cases where the return is not at the
end of the sub.  At the end of the sub, the return is optimised out of
the execution chain, so it requires a little more work, which the next
commit will do.

9 years agoconst-optree.t: More tests
Father Chrysostomos [Sun, 2 Nov 2014 05:01:54 +0000 (22:01 -0700)]
const-optree.t: More tests

Test explicit return with variable (single statement) and simple scalar
not modified elsewhere.

9 years agoDon’t inline sub(){my $x; state sub z {$x} $outer}
Father Chrysostomos [Sun, 2 Nov 2014 04:52:08 +0000 (21:52 -0700)]
Don’t inline sub(){my $x; state sub z {$x} $outer}

The code that determines whether a closure prototype is potentially eligi-
ble for inlining when cloned iterates through the op chain in the order it
is executed.  It looks for padsv (or const) followed by sub exit.  Cer-
tain ops with no side effects, like nextstate and null, are skipped over.
There is a flaw in the logic handling padsv ops.  If the padsv op closes
over a variable from outside, we record that we have seen an SV, so
another padsv or const prevents inlining.  If the first padsv op does
not close over a variable from outside, but belongs to this sub itself,
then we just ignore it and skip over it as we would a null op.  So that
means sub () { my $x; $outer_var } is marked as potentially eligible
for inlining.

Now, when cloning happens (i.e., when the ‘sub’ expression is evaluated),
we search through the op chain (once more) of subs marked as potentially
inlinable and find the first padsv op, which we assume is the one that
closes over the outer sub.  So we get the value of the wrong variable.

Now, there is a reference count check that usually saves the day.  The
reference count must be exactly 2, one reference held by the newly-cloned
closure and the other by the outer sub.  Usually ‘my $x’ will have a ref-
erence count of 1 when the sub is cloned, so it does not become inlina-
ble, but behaves as expected.

With state subs, however, which are cloned when the enclosing sub is
cloned, we can make that inner lexical have a reference count of 2.
So the sub becomes inlinable, using the undefined value taken from the
wrong variable:

$ ./perl -Ilib -MO=Concise -Mfeature=:all -e 'BEGIN { my $x = 43; *foo = sub :prototype(){my $y; state sub z { $y } $x}} print foo()'
The lexical_subs feature is experimental at -e line 1.
6  <@> leave[1 ref] vKP/REFC ->(end)
1     <0> enter ->2
2     <;> nextstate(main 53 -e:1) v:%,{,469764096 ->3
5     <@> print vK ->6
3        <0> pushmark s ->4
4        <$> const[NULL ] s*/FOLD ->5
-e syntax OK

Notice the const[NULL ], which indicates undef.

At least that’s what we get if we are lucky enough not to crash in the
padname-handling code added recently to op.c:op_const_sv.  Sometimes
this results:

$ ./perl -Ilib -MO=Concise -Mfeature=:all -e 'BEGIN { my $x = 43; *foo = sub :prototype(){my $y; state sub z { $y } $x}} print foo()'
The lexical_subs feature is experimental at -e line 1.
Segmentation fault: 11

9 years agoDon’t inline sub(){0; $x} if $x changes elsewhere
Father Chrysostomos [Sun, 2 Nov 2014 02:08:46 +0000 (19:08 -0700)]
Don’t inline sub(){0; $x} if $x changes elsewhere

Some op trees will turn a sub into a constant even if they
are more than just a simple constant or lexical variable.  In
particular, a statement optimised away followed by a lexi-
cal variable is eligible for inlining.  As discussed in
<20141101170924.17763.qmail@lists-nntp.develooper.com>, make these
more complex op trees follow closure rules properly.  If the outer
lexical is used in lvalue context in places other than its declara-
tion, then we should forego inlining.

9 years agoRestructure const-optree.t
Father Chrysostomos [Sun, 2 Nov 2014 01:45:37 +0000 (18:45 -0700)]
Restructure const-optree.t

This new layout (it is completely rewritten) allows endless variations
to be tested more easily.

9 years agoUse ‘behavior’ consistently in perldiag
Father Chrysostomos [Sat, 1 Nov 2014 23:41:23 +0000 (16:41 -0700)]
Use ‘behavior’ consistently in perldiag

‘Behavior’ is used many times; ‘behaviour’ only three.

9 years agoDeprecate inlining sub(){$x} if $x is changed elsewhere
Father Chrysostomos [Sat, 1 Nov 2014 14:07:36 +0000 (07:07 -0700)]
Deprecate inlining sub(){$x} if $x is changed elsewhere

With the new PadnameLVALUE flag, we can detect cases where an outer
lexical is used multiple times in lvalue context.  If the subroutine
contains just a lexical variable and nothing else, deprecate this
behaviour, so we can change it not to break the closure pattern at
some future date.

Future commits will fix those cases where the subroutine contains more
than just a lexical variable, without a deprecation cycle.

Adding this code to op_const_sv doesn’t really make sense.  More to
the point, having S_cv_clone_pad call op_const_sv doesn’t make sense,
but changing that (moving this code directly to S_cv_clone_pad) will
require other refactorings to avoid breaking some cases of constant
(real constant)  inlining, such as sub(){$x++ if 0; 3}, which cur-
rently gets inlined.

9 years agoPut sub(){ ... } constant tests in a new file
Father Chrysostomos [Sat, 1 Nov 2014 21:33:35 +0000 (14:33 -0700)]
Put sub(){ ... } constant tests in a new file

9 years agopad.c: Move constant closure code
Father Chrysostomos [Sat, 1 Nov 2014 05:08:52 +0000 (22:08 -0700)]
pad.c: Move constant closure code

S_cv_clone normally calls S_cv_clone_pad, which takes care of cloning
the pad, surprisingly enough.  Then S_cv_clone checks whether it can
turn a closure into a constant.  That code needs to be moved into
S_cv_clone_pad, because, not only is it pad-related, but to work cor-
rectly it needs to access the outer sub (which S_cv_clone_pad already
fetches for its own use), which future commits will make it do.

9 years agopad.c: Have S_cv_clone_pad return the CV
Father Chrysostomos [Sat, 1 Nov 2014 05:04:21 +0000 (22:04 -0700)]
pad.c: Have S_cv_clone_pad return the CV

Currently it is a void function, because it modifies the CV in place.
Shortly it will sometimes return a different CV from the one it was
passed.

9 years agopad.c:S_cv_clone: Add assertion
Father Chrysostomos [Sat, 1 Nov 2014 04:59:39 +0000 (21:59 -0700)]
pad.c:S_cv_clone: Add assertion

This code cannot handle the case where cloning uses an existing
stub, because it creates a new CV via newCONSTSUB.  Cloning into
an existing stub only happens for lexical subs, and the previous
commit prevented them from reaching this code.  Before that we
would have had assertion failures in pp_padcv.

9 years agoDon’t attempt to inline my sub (){$outer_var}
Father Chrysostomos [Sat, 1 Nov 2014 04:57:28 +0000 (21:57 -0700)]
Don’t attempt to inline my sub (){$outer_var}

$ perl5.18.2 -Ilib  -Mfeature=lexical_subs -e ' my $x; my sub a(){$x}; print a'
The lexical_subs feature is experimental at -e line 1.
Segmentation fault: 11

Same in blead.

When calls to the sub are compiled (the ‘a’ in ‘print a’) the value
of the lexical variable cannot possibly known, because the sub hasn’t
been cloned yet, and all we have is the closure prototype.

A potentially constant closure prototype is marked CvCONST and
cv_const_sv_or_av (called by the code in toke.c that handles bare-
words) thinks that CvCONST means we have a constant XSUB.  Only lexi-
cal subs allow a closure prototype to reach that function.

We shouldn’t mark the closure prototype as CvCONST to begin with.
Because when we do, the ‘constant’ is retrieved from CvXUBANY, which
is a union shared by CvSTART.  Then toke.c does SvREFCNT_inc on
CvSTART, and screws up the op tree.

9 years agoop.c: Record lvalue use of lexicals
Father Chrysostomos [Fri, 31 Oct 2014 22:54:39 +0000 (15:54 -0700)]
op.c: Record lvalue use of lexicals

other than where the variable is declared.

This will be used to determine whether my $x; sub(){$x} can make a
constant.  Currently, this becomes a constant even if $x is subse-
quently modified, breaking the closure behaviour (bug #79908).

9 years agoAdd new LVALUE flag for pad names
Father Chrysostomos [Fri, 31 Oct 2014 21:54:20 +0000 (14:54 -0700)]
Add new LVALUE flag for pad names

This will be used to record whether a pad entry is used as an lvalue
multiple times.  If so, it cannot be used as a constant.

9 years agoUpdate comments about sub(){$x} consting
Father Chrysostomos [Thu, 30 Oct 2014 15:56:44 +0000 (08:56 -0700)]
Update comments about sub(){$x} consting

It no longer has anything to do with constant.pm.

9 years agoDon’t turn sub:CustomAttr(){$outer_lex} into a const
Father Chrysostomos [Thu, 30 Oct 2014 15:52:56 +0000 (08:52 -0700)]
Don’t turn sub:CustomAttr(){$outer_lex} into a const

We can’t know what the attributes are for, and turning it into a con-
stant discards the attributes.

9 years agoPreserve :method in sub:method(){$outer_lex}
Father Chrysostomos [Thu, 30 Oct 2014 15:46:00 +0000 (08:46 -0700)]
Preserve :method in sub:method(){$outer_lex}

When we turn such a sub into a constant, we need to preserve the
attribute, since it changes behaviour.

9 years agoMake sub(){$outer_lexical} return a copy each time
Father Chrysostomos [Thu, 30 Oct 2014 12:08:19 +0000 (05:08 -0700)]
Make sub(){$outer_lexical} return a copy each time

We don’t actually stop in from being inlined, but simply mark the
inlined value as PADTMP, so it gets copied in lvalue context.

9 years agosub(){__SUB__} under -d, sub{eval"";__SUB__}
Father Chrysostomos [Thu, 13 Nov 2014 05:56:37 +0000 (21:56 -0800)]
sub(){__SUB__} under -d, sub{eval"";__SUB__}

The peephole optimiser changes __SUB__ to a constant if the sub is not
clonable.  All anonymous subs are clonable under the debugger, but
they are not marked as such until after the peephole optimiser runs.

If a sub is clonable, then it undergoes a second search through the
op tree (op_const_sv) to see if it is inlinable.  Trying to make
sub(){__SUB__} inlinable results in some sort of memory corruption,
in which it presumably points to a freed SV that get reused for some-
thing else:

$ PERL5DB='sub DB::DB{}' ./perl -dIlib  -lE 'BEGIN{*f = sub(){__SUB__}}; print f; print \&f'
*IO::File::AUTOLOAD
CODE(0x7fef62035760)

(Both lines should show the same thing.)

The same clonability applies to subs containing a string eval.  The
sub is not marked clonable yet when __SUB__ becomes a constant, so it
ends up referring to the closure prototype:

$ ./perl -Ilib  -lE 'BEGIN{*f = sub(){eval""; __SUB__}}; print f; print \&f; f->()'
CODE(0x7fe8c2036fe8)
CODE(0x7fe8c2031730)
Closure prototype called at -e line 1.

When turning __SUB__ into a constant, we need to check the same con-
dition (PL_cv_has_eval || PL_perldb; see pad_tidy) that would make a
sub clonable.

9 years agoadd filename handling to xs handshake
Daniel Dragan [Thu, 13 Nov 2014 06:59:06 +0000 (01:59 -0500)]
add filename handling to xs handshake

- this improves the error message on ABI incompatibility, per
  [perl #123136]
- reduce the number of gv_fetchfile calls in newXS over registering many
  XSUBs
- "v" was not stripped from PERL_API_VERSION_STRING since string
  "vX.XX.X\0", a typical version number is 8 bytes long, and aligned to
  4/8 by most compilers in an image. A double digit maint release is
  extremely unlikely.
- newXS_deffile saves on machine code in bootstrap functions by not passing
  arg filename
- move newXS to where the rest of the newXS*()s live
- move the "no address" panic closer to the start to get it out of the way
  sooner flow wise (it nothing to do with var gv or cv)
- move CvANON_on to not check var name twice
- change die message to use %p, more efficient on 32 ptr/64 IV platforms
  see ML post "about commit "util.c: fix comiler warnings""
- vars cv/xs_spp (stack pointer pointer)/xs_interp exist for inspection by
  a C debugger in an unoptimized build

9 years agocurrent_sub.t: Test sub(){__SUB__}
Father Chrysostomos [Thu, 13 Nov 2014 04:27:03 +0000 (20:27 -0800)]
current_sub.t: Test sub(){__SUB__}

If the constant inlining algorithm changes, we need to make sure not
to break sub(){__SUB__} accidentally.

Sometimes __SUB__ gets optimised to a constant.  Constant inlining
searches the op tree for constants.  Currently we are saved by the
fact that the search happens before the peephole optimizer does the
conversion.

9 years agoHave Deparse use %B::Op_private::ops_using
Father Chrysostomos [Thu, 13 Nov 2014 04:11:23 +0000 (20:11 -0800)]
Have Deparse use %B::Op_private::ops_using

9 years ago[perl #123161] Add %B::Op_private::ops_using
Father Chrysostomos [Thu, 13 Nov 2014 04:09:44 +0000 (20:09 -0800)]
[perl #123161] Add %B::Op_private::ops_using

9 years agorepeat.t: Correct comment
Father Chrysostomos [Wed, 12 Nov 2014 00:02:24 +0000 (16:02 -0800)]
repeat.t: Correct comment

When a57276195 changed the eq to is(), the comment was not updated.
The test still works.  (I tried introducing the bug it was testing
for via SP--, and it failed as expected.)

9 years ago[perl #123163] use the original link order unless on os390
Tony Cook [Wed, 12 Nov 2014 05:46:48 +0000 (16:46 +1100)]
[perl #123163] use the original link order unless on os390

9 years agoSpecial case exp(1) for ppc64-linux.
Jarkko Hietaniemi [Tue, 11 Nov 2014 23:36:57 +0000 (18:36 -0500)]
Special case exp(1) for ppc64-linux.

9 years agoRevert "sisyphus thinks the test value is simply wrong here."
Jarkko Hietaniemi [Tue, 11 Nov 2014 23:27:51 +0000 (18:27 -0500)]
Revert "sisyphus thinks the test value is simply wrong here."

This reverts commit 5399a05dbb94d8e0c2a0ea2b588ff80ad23f2093.

(sisyphus thinks the bug is actually in ppc64 linux exp())

9 years agoIf long double math functions do not work, drop uselongdouble.
Jarkko Hietaniemi [Tue, 11 Nov 2014 23:14:40 +0000 (18:14 -0500)]
If long double math functions do not work, drop uselongdouble.

This moves a earlier version of the test from the freebsd hints
to Configure, thus stopping also any other platforms that have
lacking longdouble implementations.

The test is not comprehensive (not all long double interfaces are tested),
but it covers some of the most common ones.

The earlier test was actually wrong, so no FreeBSD could ever pass.
Sorry, FreeBSD.

9 years agoTest reference to unavailable lexical variable
Father Chrysostomos [Wed, 12 Nov 2014 05:28:53 +0000 (21:28 -0800)]
Test reference to unavailable lexical variable

This is related to #123172.

v5.21.3-644-ge52eb89 inadvertently fixed this old bug, which was prob-
ably introduced by the jumbo closure patch:

$ perl5.8.9 -le 'sub { my $f; BEGIN { $ref = \$f; $f = 7; $$ref = 8; print $f } }'
8
$ perl5.10 -le 'sub { my $f; BEGIN { $ref = \$f; $f = 7; $$ref = 8; print $f } }'
7
$ perl5.20.1 -le 'sub { my $f; BEGIN { $ref = \$f; $f = 7; $$ref = 8; print $f } }'
7
$ perl5.21.5 -le 'sub { my $f; BEGIN { $ref = \$f; $f = 7; $$ref = 8; print $f } }'
8

\ was returning a *copy* of its referent if the latter closed over an
anonymous sub’s stale variable.

9 years agoDon’t make temp copy for ()=...
Father Chrysostomos [Tue, 11 Nov 2014 23:46:30 +0000 (15:46 -0800)]
Don’t make temp copy for ()=...

List assignment will make temporary copies if either side contains ops
that *might* occur elsewhere on the stack.  That is obviously not nec-
essary for ()=....

()= is often used to count the number of items, suppress void warn-
ings, or force list context, so it’s worth optimising it.

It’s actually possible to test this without examining the op tree.
Just see whether we have redundant FETCH calls on items not assigned.

9 years agoIncrease $Exporter::VERSION to 5.72
Father Chrysostomos [Tue, 11 Nov 2014 23:42:13 +0000 (15:42 -0800)]
Increase $Exporter::VERSION to 5.72

9 years agoIncrease $Unicode::UCD::VERSION to 0.59
Father Chrysostomos [Tue, 11 Nov 2014 23:41:36 +0000 (15:41 -0800)]
Increase $Unicode::UCD::VERSION to 0.59

9 years agorename anonymous list -> array in docs
Doug Bell [Tue, 11 Nov 2014 21:19:45 +0000 (15:19 -0600)]
rename anonymous list -> array in docs

9 years agoUpdate Porting/Maintainers.pl for alpha Test-Simple
Chad Granum [Tue, 11 Nov 2014 16:46:36 +0000 (08:46 -0800)]
Update Porting/Maintainers.pl for alpha Test-Simple

9 years agoUpdate Test-Simple to alpha 073
Chad Granum [Tue, 11 Nov 2014 16:30:35 +0000 (08:30 -0800)]
Update Test-Simple to alpha 073

9 years agoRevert "Update Test-Simple to CPAN version 1.001009"
Chad Granum [Tue, 11 Nov 2014 16:28:24 +0000 (08:28 -0800)]
Revert "Update Test-Simple to CPAN version 1.001009"

This reverts commit 3709f1d4bd0179938a418d9337449fdf20a783bc.

We are using the alphas in blead currently, not stable, this update
squashed that.

9 years agoTest the prev commit
Father Chrysostomos [Tue, 11 Nov 2014 20:45:56 +0000 (12:45 -0800)]
Test the prev commit

9 years agorename [] from "anonymous list" to "anonymous array"
Lukas Mai [Tue, 11 Nov 2014 14:45:43 +0000 (15:45 +0100)]
rename [] from "anonymous list" to "anonymous array"

9 years agoperf/benchmarks.t: fix regex typo
David Mitchell [Tue, 11 Nov 2014 11:45:24 +0000 (11:45 +0000)]
perf/benchmarks.t: fix regex typo

[A-z] should be [A-Z]. Spotted by Karl Williamson.

9 years agoTrailing whitespace removed in perlport.pod
Chris 'BinGOs' Williams [Tue, 11 Nov 2014 11:30:45 +0000 (11:30 +0000)]
Trailing whitespace removed in perlport.pod

9 years agoMore lex_assign.t fix-ups
Father Chrysostomos [Tue, 11 Nov 2014 06:39:21 +0000 (22:39 -0800)]
More lex_assign.t fix-ups

Windows sometimes says ‘not implemented’.

9 years agolex_assign.t fix-up
Father Chrysostomos [Tue, 11 Nov 2014 06:35:44 +0000 (22:35 -0800)]
lex_assign.t fix-up

Duh.

If an operator fails (e.g., due to platform incompatibility), the
assignment won’t happen.  So allow a STORE count of 0 if the eval
fails.

9 years agoExtend OPpTARGET_MY optimisation to state var init
Father Chrysostomos [Tue, 11 Nov 2014 04:00:53 +0000 (20:00 -0800)]
Extend OPpTARGET_MY optimisation to state var init

ck_sassign does two things:

• See if $lexical = <some op> can have the assignment optimised away
  (OPpTARGET_MY/targlex).
• See if we have state $x = foo, which needs to run only once
  per closure.

The former optimisation is skipped for variable declarations (‘my $x
= time’), because ‘my $x’ does more than just return the SV at a pad
offset.  It also arranges for it to be cleared on scope exit.  That
does not apply to state variable.  The OPpLVAL_INTRO flag (indicating
the presence of ‘my’ or ‘state’ before the variable) has no run-time
effect on state vars, so there is no need to skip the optimisation
because of it.

That optimisation destroys the assignment operator and its lhs before
we get to the state var init code, which needs the lhs to do its
checks.  So we change the order that these checks happen, and make the
state var code invoke the optimisation itself.

9 years agoop.c:ck_sassign: Move targlex to static func
Father Chrysostomos [Tue, 11 Nov 2014 03:33:11 +0000 (19:33 -0800)]
op.c:ck_sassign: Move targlex to static func

ck_sassign does two things:

• See if $lexical = <some op> can have the assignment optimised away
  (targlex).
• See if we have state $x = foo, which needs to run only once
  per closure.

Putting the former in a static routine will allow the latter to call
it, too, sowe can extend the targlex optimisation to state variable
initialization.

9 years agoop.c:ck_sassign: correct comment
Father Chrysostomos [Tue, 11 Nov 2014 03:15:27 +0000 (19:15 -0800)]
op.c:ck_sassign: correct comment

state $x = time does not have a listop.
state $x : nifty = time does.

9 years agoop.c:ck_sassign: Don’t check the pad name for state
Father Chrysostomos [Tue, 11 Nov 2014 02:57:45 +0000 (18:57 -0800)]
op.c:ck_sassign: Don’t check the pad name for state

The padsv op will already have its state flag set by this point, so we
can merge two flag checks into one, resulting in smaller machine code.

9 years agoSuppress warning from lex_assign.t
Father Chrysostomos [Tue, 11 Nov 2014 02:43:29 +0000 (18:43 -0800)]
Suppress warning from lex_assign.t

9 years agoDon’t call STORE twice on setpgrp target
Father Chrysostomos [Tue, 11 Nov 2014 02:39:57 +0000 (18:39 -0800)]
Don’t call STORE twice on setpgrp target

If the target is a lexical variable (as happens with ‘$lex = setpgrp’,
in which the assignment is optimised away), then doing set-magic mul-
tiple times has an observable effect.  This was only happening when it
was called with no arguments.

This double STORE goes back to 1f200948c4c.  1f200948c4c was just
meant to fix a stack bug, but extending the stack when necessary, but
it was also push TARG and setting it to -1, only for it to be over-
written shortly.  (Also, it didn’t fully fix the stack bugs.  See
88d6953212e.)

9 years agoDon’t treat setpgrp($nonzero) as setpgrp(1)
Father Chrysostomos [Tue, 11 Nov 2014 02:22:43 +0000 (18:22 -0800)]
Don’t treat setpgrp($nonzero) as setpgrp(1)

This was broken inadvertently by 92f2ac5f (5.15.3).

I really have no idea how to test this.  I only confirmed the bug and
its fix via a temporary warn statement in pp_setpgrp (obviously not
included in this commit).

9 years agoCall STORE on lexical $tied = vec/chr
Father Chrysostomos [Mon, 10 Nov 2014 22:51:01 +0000 (14:51 -0800)]
Call STORE on lexical $tied = vec/chr

The assignment gets optimised away, so pp_vec and pp_chr need to call
SvSETMAGIC on their targets.

This bug started happening with vec just recently, in db098081, when
the OPpTARGET_MY optimisation was applied to it.

The bug started happening with chr for the same reason, but back in
5.6.0 (b162f9ea).

I moved the STORE tests down in lex_assign.t when expanding them, to
avoid sabotaging the tests that check the results of the expressions
after the __END__ marker.

9 years agoDon’t allow OPpTARGET_MY with integer negation
Father Chrysostomos [Mon, 10 Nov 2014 07:53:42 +0000 (23:53 -0800)]
Don’t allow OPpTARGET_MY with integer negation

$ ./perl -Ilib -le 'use integer; my $a = "fake"; $a = -$a; print "[$a]"'
[--]

As of 1c2b3fd6f1, negation under ‘use integer’ can do string negation,
which modifies the return value before reading the argument.  So, like
regular non-integer negation, it must forego this optimisation.

9 years agoop_private: Update concat TARGLEX comment
Father Chrysostomos [Mon, 10 Nov 2014 07:49:09 +0000 (23:49 -0800)]
op_private: Update concat TARGLEX comment

This changed in 69b47968fa.

9 years agolex_assign.t: Add comment explaining this file
Father Chrysostomos [Mon, 10 Nov 2014 07:40:16 +0000 (23:40 -0800)]
lex_assign.t: Add comment explaining this file

9 years agolex_assign.t: Don’t skip all failing tests
Father Chrysostomos [Mon, 10 Nov 2014 07:37:00 +0000 (23:37 -0800)]
lex_assign.t: Don’t skip all failing tests

This was emasculated by 5cd1152e1.

Also, yank some crazy skip code that goes like this:

    if ($condition) {
       SKIP: {
          skip "reason", 1; # unconditionally
          pass(); # unreached
       }
    }

9 years agopp.c:do_chomp: Remove redundant assignment
Father Chrysostomos [Mon, 10 Nov 2014 03:57:55 +0000 (19:57 -0800)]
pp.c:do_chomp: Remove redundant assignment

The value of s is not used after this.

9 years agodont run extension building make twice on a fresh src tree
Daniel Dragan [Mon, 10 Nov 2014 03:57:08 +0000 (22:57 -0500)]
dont run extension building make twice on a fresh src tree

On a fresh source tree, "[*]make config" then "[*]make all" are executed.
The "make config" is redundant in this case, and launching make process
twice, plus make's I/O calls is inefficient. On a dirty source tree, this
would break since the makefile will regenerate. If "make all" fails the
first time (presumably because because the makefile was regened, other
failures just run/print twice), run the "make all" more time. Dirty trees
still run make twice, clean trees drop from running make twice to just
once.

9 years agoUpdate ExtUtils-MakeMaker to CPAN version 7.02
Chris 'BinGOs' Williams [Sat, 8 Nov 2014 14:11:24 +0000 (14:11 +0000)]
Update ExtUtils-MakeMaker to CPAN version 7.02

  [DELTA]

7.02 Sat Nov  8 07:13:40 GMT 2014

    No changes from 7.01_09

7.01_09 Thu Nov  6 21:41:32 GMT 2014
    Test fixes:
    - Marked a test in pm_to_blib.t as TODO until further
      investigation can be scheduled

7.01_08 Tue Nov  4 20:24:29 GMT 2014
    Test fixes:
    - roll back change in 7.01_07 and scrub PERL_INSTALL_QUIET
      environment variable

7.01_07 Tue Nov  4 19:26:46 GMT 2014
    Test fixes:
    - Changed a regex in pm_to_blib.t to be more forgiving

7.01_06 Mon Nov  3 20:31:05 GMT 2014
    Bug fixes:
    - Resolved regression with TEST_FILES

    Win32 fixes:
    - Targetted fix for nmake bug
    - miniperl.t core test fixed for Windows

7.01_05 Mon Nov  3 10:14:11 GMT 2014
    VMS fixes:
    - Handle switches in $(PERL) by prepending MCR
    - Don't quote MAKE on VMS in Test::Utils

7.01_04 Fri Oct 31 09:38:06 GMT 2014
    API change:
    - writeMakefile() has been removed after 20 years of being deprecated

    Bug fixes:
    - Regression in xs.t with older versions of xsubpp has been resolved
    - We now don't produce Borland C export symbols if BCC support dropped

7.01_03 Thu Oct 30 19:12:57 GMT 2014
    Bug fixes:
    - Using NMAKE was broken this has been fixed

7.01_02 Sat Oct 25 17:45:46 BST 2014
    Bug fixes:
    - Resolve a regression with FIXIN and core builds on Win32

7.01_01 Sat Oct 25 13:45:00 BST 2014
    Bug fixes:
    - Resolve issue with Win32 perl builds in core

7.00 Wed Oct 22 20:13:38 BST 2014

    No changes from 6.99_18

6.99_18 Mon Oct 20 10:02:58 BST 2014
    Bug fixes:
    - Resolve regression with taint and get_version() [RT#99580]

    VMS fixes:
    - Avoid .NOTPARALLEL on VMS as it is a syntax error for MMS and MMK
    - Quotes are not stripped from argv[0] on VMS so need stripping
    - Move MCR from PERL to PERLRUN on VMS and other *RUN variables

6.99_17 Sun Oct 12 19:37:04 BST 2014
    Bug fixes:
    - Fix test that got broke under core since 6.99_15

6.99_16 Thu Oct  2 19:29:49 BST 2014
    Dist fixes:
    - Move File::Copy::Recursive from bundled to where it is
      used, so that it will not get installed as a runtime
      prereq

6.99_15 Sun Sep 21 13:21:46 BST 2014
    Enhancements:
    - If core, add ccwarnflags and ccstdflags, if available

    Doc fixes:
    - Fix internal links

6.99_14 Fri Sep 19 14:59:08 BST 2014
    Bug fixes:
    - Fixes to fallback version module for core integration problems

6.99_13 Mon Sep 15 20:02:47 BST 2014
    Enhancements:
    - Bundle Encode::Locale as ExtUtils::MakeMaker::Locale

    Bug fixes:
    - Make included version module have standardised dist versioning

6.99_12 Thu Sep 11 15:27:31 BST 2014
    Enhancements:
    - Now include a fallback version module for bootstrapping

    Bug fixes:
    - Support libfoo.0.dylib style libraries on Darwin

6.99_11 Mon Sep  8 14:20:26 BST 2014
    Bug fixes:
    - Handle chcp failure better on MSWin32
    - Tests should be parallelisable once again

    Doc fixes:
    - Document that GNU make is usable on MSWin32 now

6.99_10 Thu Sep  4 14:28:01 BST 2014
    Bug fixes:
    - Fixes for being integrated with core
    - Fixed the code page reset on MSWin32
    - Fixed test failures on BSD with UTF8 filenames
    - Fixed regression with quoting of $(PERL) when
      command line flags are used

6.99_09 Thu Aug 28 11:01:37 BST 2014
    Enhancements:
    - Support GNU Make on Windows
    - Support paths and filenames that are UTF8 encoded
    - MM->can_run() added for finding programs (ported from
      IPC::Cmd)

    Bug fixes:
    - Handle UTF8 when generating manpages correctly
    - Generated Makefile contents are now consistently sorted

6.99_08 Mon Aug 18 14:17:04 BST 2014
    Bug fixes:
    - Liblist::Kid: can now handle -l:foo.so invocations properly
    - Scripts will no longer have the 'not running under some shell' code
      applied when rewriting shebang lines.
    - version is now used to parse prereqs versions internally
    - Support UTF8 encoded command-line args and Makefile.PL args
    - Generated META.files will now always have linefeed EOLs, even on
      Windows
    - Rewrite the version line eval handling to have less insane edge cases

    Doc fixes:
    - Documentation now includes links to Dist::Zilla, File::ShareDir and
      File::ShareDir::Install
    - Clarified support policy for < v5.8.1 in README

    Misc:
    - Updated bundled CPAN::Meta::Requirements to version 2.126
    - Updated bundled ExtUtils::Manifest to version 1.65

6.99_07 Wed Jul 30 17:36:14 BST 2014
    Bug fixes:
    - Resolve 'wide character in print' warnings

6.99_06 Mon Jul 28 15:02:25 BST 2014
    Enhancements:
    - Improvements and tests for the spaces-in-stuff handling

6.99_05 Tue Jul 22 12:32:03 BST 2014
    Enhancements:
    - Enable working with (including installing to) directories with spaces in names

6.99_04 Sat Jul 12 12:43:08 BST 2014
    Enhancements:
    - No longer report each file being manified. Only summarise.

6.99_03 Fri Jul  4 11:02:21 BST 2014
    Doc Fixes:
    - PATCHING document has been rewritten as CONTRIBUTING and TODO
      document has been removed

    Bug Fixes:
    - Rearranged bundled prereqs so CPAN::Meta::Requirements won't
      get stomped on if it is installed already, but CPAN::Meta isn't

6.99_02 Thu Jun  5 12:15:28 BST 2014
    Bug fixes:
    * MM->parse_version will no longer warn if it could
      not determine the $VERSION due to syntax errors etc.

6.99_01 Tue Jun  3 22:17:30 BST 2014
    Bug fixes:
    * Disregard some warnings during tests when cross-compiling

    Doc fixes:
    * Clarified the use and limitations of META_ADD, META_MERGE

    Test fixes:
    * Sanitise env vars in tests

9 years agoNetBSD 5.1 doesn't support some of the new symbols POSIX wants
Tony Cook [Mon, 10 Nov 2014 05:01:02 +0000 (16:01 +1100)]
NetBSD 5.1 doesn't support some of the new symbols POSIX wants

9 years agoMore TARGLEX comments in op_private
Father Chrysostomos [Mon, 10 Nov 2014 02:28:34 +0000 (18:28 -0800)]
More TARGLEX comments in op_private

9 years agopp.c:do_chomp: Remove redundant sv_force_normal
Father Chrysostomos [Mon, 10 Nov 2014 02:25:44 +0000 (18:25 -0800)]
pp.c:do_chomp: Remove redundant sv_force_normal

We do SvPV_force later on, which also handles COWs.  If there was
nothing to chomp, we were flattening the COW needlessly.

We need to do an IsCOW check later, though, for chop (not chomp).

9 years agoFix $lex = chomp $lex regression from 5.12
Father Chrysostomos [Mon, 10 Nov 2014 01:36:44 +0000 (17:36 -0800)]
Fix $lex = chomp $lex regression from 5.12

Commit 2f9970be0 (5.13.9) caused the lhs to be written to with 0
before the chomp happens, and then incremented for each chomp on the
rhs argument.

That makes

    my $a = $/ = 7;
    $a = chomp $a;
    print $a;

print 0 instead of 1 and makes

    my $a = $/ = 0;
    $a = chomp $a;

assign the empty string to $a instead of 1.

9 years ago[perl #121337] fix issues with op/utf8cache.t
Tony Cook [Tue, 4 Nov 2014 06:26:21 +0000 (17:26 +1100)]
[perl #121337] fix issues with op/utf8cache.t

This test had two problems:

- it used Devel::Peek::Dump() without loading it, broken when the script
  was refactored to use test.pl in c45bec600

- the C< open CHILD "-|" > doesn't work on Win32

Since the test didn't check it was receiving reasonable dump output,
neither problem resulted in a test failure.

9 years agoPoisonPADLIST should not be totally empty.
Jarkko Hietaniemi [Sun, 9 Nov 2014 23:26:06 +0000 (18:26 -0500)]
PoisonPADLIST should not be totally empty.

(It is e.g. used as "... else PoisonPADLIST();" in sv.c)

9 years agoTxoic tpyo.
Jarkko Hietaniemi [Sun, 9 Nov 2014 23:03:43 +0000 (18:03 -0500)]
Txoic tpyo.

9 years agoFreeBSD may not have the C99 long double math interfaces.
Jarkko Hietaniemi [Sun, 9 Nov 2014 21:42:18 +0000 (16:42 -0500)]
FreeBSD may not have the C99 long double math interfaces.

(This sanity logic could migrated to Configure)

9 years agoDon’t allow OPpTARGET_MY on postdec/inc
Father Chrysostomos [Sun, 9 Nov 2014 20:50:54 +0000 (12:50 -0800)]
Don’t allow OPpTARGET_MY on postdec/inc

I was wrong in 9e319cc4f.  postfix ++/-- writes to its return value
before reading its argument.  If we optimise away the scalar
assignment in

    $a = $b++;

(that’s what OPpTARGET_MY does), then $a gets written to before $b is
read.  If $a and $b are the same, we get the wrong answer.  This bug
has been present under ‘use integer’ since 5.6.0.  I accidentally
extended it to non-integer ++/-- in 9e319cc4f.

(It’s not likely that someone will write $a = $b++, but it could hap-
pen inadvertently in more complex code.)

9 years agotr_utf8.t: Suppress warning
Father Chrysostomos [Sun, 9 Nov 2014 19:48:49 +0000 (11:48 -0800)]
tr_utf8.t: Suppress warning

9 years agosv.c:find_uninit_var: use newSVpvs_flags
Father Chrysostomos [Sun, 9 Nov 2014 19:42:58 +0000 (11:42 -0800)]
sv.c:find_uninit_var: use newSVpvs_flags

This makes the machine code smaller.

9 years agoop.c:bind_match: remove redundant var
Father Chrysostomos [Sun, 9 Nov 2014 19:41:43 +0000 (11:41 -0800)]
op.c:bind_match: remove redundant var

This shrinks the machine code slightly.

9 years agoSkip padsv op in $lex =~ ...
Father Chrysostomos [Sun, 9 Nov 2014 19:36:19 +0000 (11:36 -0800)]
Skip padsv op in $lex =~ ...

m//, s/// and y/// already have logic to deal with implicit lexical
$_.  The pad offset of $_ is stored in the match op itself.  We can
take advantage of that and extend it to lexical variables in general.
That way we have fewer ops to execute, as $lex =~ // no longer calls
pp_padsv.  It also allows lexical variables’ names to be mentioned in
uninitialized warnings for y///.

9 years agoDon’t check OPpTARGET_MY on match ops at run time
Father Chrysostomos [Sun, 9 Nov 2014 18:54:39 +0000 (10:54 -0800)]
Don’t check OPpTARGET_MY on match ops at run time

The offset in op_targ is sufficient.  The next commit will take advan-
tage of this.

9 years agoutil.c: fix comiler warnings
David Mitchell [Sun, 9 Nov 2014 15:43:10 +0000 (15:43 +0000)]
util.c: fix comiler warnings

A recent commit gave some warnings about format types,
and assignments without extra parens within an if condition.

9 years agoVersion bump for File::Spec::VMS.
Craig A. Berry [Sun, 9 Nov 2014 03:22:55 +0000 (21:22 -0600)]
Version bump for File::Spec::VMS.

9 years agoSimplify abs2rel.t.
Craig A. Berry [Sun, 9 Nov 2014 03:16:12 +0000 (21:16 -0600)]
Simplify abs2rel.t.

Factor out all the things that were common for the different test
cases (which was everything except the filename).  And use made-up
names that indicate what's being tested rather than special system
filenames commonly found on Unix systems.  Otherwise, if, for
example, a test for "'init.d' is a directory" fails, you'd be
wondering whether something is wrong with your system rather than
looking for problems in File::Spec, which is what we're testing.

9 years agoFix undefined warning in File::Spec::VMS::catfile.
Craig A. Berry [Sun, 9 Nov 2014 03:08:16 +0000 (21:08 -0600)]
Fix undefined warning in File::Spec::VMS::catfile.

We had very carefully created a lexical variable to hold a default
result when the filename was undefined.  Then we forgot to use it.

Now we use it.

9 years agoForce barename base to be a directory in File::Spec::VMS:abs2rel.
Craig A. Berry [Sun, 9 Nov 2014 00:43:15 +0000 (18:43 -0600)]
Force barename base to be a directory in File::Spec::VMS:abs2rel.

The docs say that the filename portion of base is ignored, but they
don't specify what happens when base is a single component without
directory syntax, leaving ambiguous whether it's a file or a Unix-
style directory spec.  Let's default to the latter for greatest
consistency with what happens elsewhere.

9 years agoRevise Unix syntax detection File::Spec::VMS::abs2rel.
Craig A. Berry [Sun, 9 Nov 2014 00:27:44 +0000 (18:27 -0600)]
Revise Unix syntax detection File::Spec::VMS::abs2rel.

For a long time we've punted to the Unix method if either path or
base has a forward slash in it.  But that really only works if
*both* are not native specs.  So check for that by making sure we
don't have unescaped left bracket (square or angle) or colon in
either parameter before handing off to File::Spec::Unix::abs2rel.

9 years agoMove rel2abs earlier in File::Spec::VMS::abs2rel.
Craig A. Berry [Sun, 9 Nov 2014 00:13:38 +0000 (18:13 -0600)]
Move rel2abs earlier in File::Spec::VMS::abs2rel.

We need to make the path and base parameters absolute before
splitting them apart and comparing their pieces.  Since rel2abs
will do its own canonpath, we don't need to do that anymore here.

9 years agoExtend y/// warnings to utf8
Father Chrysostomos [Sun, 9 Nov 2014 06:48:12 +0000 (22:48 -0800)]
Extend y/// warnings to utf8

9 years agorelease_schedule.pod: Correct some versions
Father Chrysostomos [Sun, 9 Nov 2014 06:06:55 +0000 (22:06 -0800)]
release_schedule.pod: Correct some versions

9 years agorelease schedule: 5.18.4 shipped, 5.18.5 may happen
Ricardo Signes [Sun, 9 Nov 2014 04:18:39 +0000 (23:18 -0500)]
release schedule: 5.18.4 shipped, 5.18.5 may happen

9 years agorelease schedule: the v5.22 landing plan
Ricardo Signes [Sun, 9 Nov 2014 04:18:19 +0000 (23:18 -0500)]
release schedule: the v5.22 landing plan

9 years agoop.c:scalarvoid: Remove redundant scalar(o)
Father Chrysostomos [Sun, 9 Nov 2014 02:45:04 +0000 (18:45 -0800)]
op.c:scalarvoid: Remove redundant scalar(o)

9 years agoop.c:ck_sassign: Simplify freeing of sassign op
Father Chrysostomos [Sun, 9 Nov 2014 02:35:59 +0000 (18:35 -0800)]
op.c:ck_sassign: Simplify freeing of sassign op

Instead of detaching both the rhs and lhs and then freeing the assign-
ment and the lhs, just detach the rhs and free the assignment.  This
results in smaller machine code.

9 years agoDon’t use OP_SIBLING(o) in op.c:ck_sassign
Father Chrysostomos [Sun, 9 Nov 2014 02:33:19 +0000 (18:33 -0800)]
Don’t use OP_SIBLING(o) in op.c:ck_sassign

When this is called, the op is not part of a larger tree yet, so its
sibling is always NULL.

9 years agoShrink PL_op_private_bitdefs
Father Chrysostomos [Sun, 9 Nov 2014 00:49:45 +0000 (16:49 -0800)]
Shrink PL_op_private_bitdefs

It doesn’t matter whether things in this table are ordered by opcode,
because the indices into it are stored in PL_op_private_bitdef_ix.

If we have multiple ops with exactly the same private flags, we don’t
need multiple entries in PL_op_private_bitdefs.

One practical advantage is that patches are less likely to conflict,
which will make rebasing easier.  (I hope.)