In perl.git, the branch sprout/lvref has been created
<http://perl5.git.perl.org/perl.git/commitdiff/0a9766e8a6f9373260d64d378260e354f4557aeb?hp=0000000000000000000000000000000000000000>
at 0a9766e8a6f9373260d64d378260e354f4557aeb (commit)
- Log -----------------------------------------------------------------
commit 0a9766e8a6f9373260d64d378260e354f4557aeb
Author: Father Chrysostomos <[email protected]>
Date: Sat Sep 27 22:03:25 2014 -0700
Add priv flags for the type of lvalue ref
M lib/B/Op_private.pm
M opcode.h
M regen/op_private
commit 44c7cf7b7805d6ddb61939f87f7858e8167f5d55
Author: Father Chrysostomos <[email protected]>
Date: Sat Sep 27 18:44:57 2014 -0700
lvref.t: To-do tests for array ref assignment
The evals are temporary. Some of the tests donât even make sense
with the evals; they are more placeholders and reminders for now
that tests.
M t/op/lvref.t
commit 3ffde6929c152955827ef475e3e14205d945f478
Author: Father Chrysostomos <[email protected]>
Date: Sat Sep 27 14:17:09 2014 -0700
pp.c: Fold SvIV into S_localise_aelem_lval
All three callers were doing SvIV, so we can do it in one spot.
M pp.c
commit f61aa41bfd8f3172adf94b9f8de7a8944d1f5fa6
Author: Father Chrysostomos <[email protected]>
Date: Sat Sep 27 14:15:50 2014 -0700
pp.c: Some branch prediction hints
M pp.c
commit 8571c2dfd8db598ba65b14e7ffd10900824c2c73
Author: Father Chrysostomos <[email protected]>
Date: Sat Sep 27 14:15:00 2014 -0700
Assignment to hash element refs
M mg.c
M op.c
M pp.c
M t/op/lvref.t
commit 339e4b5ac0901a06dc4c51aeb6bdcff3cecbd484
Author: Father Chrysostomos <[email protected]>
Date: Sat Sep 27 11:07:35 2014 -0700
pp.c: Consolidate some local aelem code
In the process, avoid a redundant av_fetch for \local$a[0]= and
\local($a[0])=.
M pp.c
commit c4b4df98081dc9c6820d058dea82d9d2558447a5
Author: Father Chrysostomos <[email protected]>
Date: Sat Sep 27 10:49:46 2014 -0700
pp.c:pp_lvrefslice: Unused var
M pp.c
commit 736259515217ca68ce5bd73f0f700d484e7868d2
Author: Father Chrysostomos <[email protected]>
Date: Sat Sep 27 10:49:24 2014 -0700
\local $a[$ix] assignment
M pp.c
M t/op/lvref.t
commit 740dce39cb26c252290828d6064df43f6b458077
Author: Father Chrysostomos <[email protected]>
Date: Fri Sep 26 10:40:19 2014 -0700
\@array[@slice] assignment
plus changes to the aelem tests to check rhs context.
I did \local @a[@s] at the same time, since I was practically copying
and pasting code from aslice (ok, not quite).
M op.c
M pp.c
M t/op/lvref.t
commit da9de61a27dbc5ba16c2c7e567bf5b2bc5b75296
Author: Father Chrysostomos <[email protected]>
Date: Thu Sep 25 22:13:33 2014 -0700
pp.c: Dodge compiler warning
M pp.c
commit e5a212c3e723b7f13f07a950a343425520f8abb5
Author: Father Chrysostomos <[email protected]>
Date: Thu Sep 25 22:10:39 2014 -0700
lvrefslice gets OPpLVAL_INTRO
M lib/B/Op_private.pm
M opcode.h
M regen/op_private
commit d74896ae33d10830875a41983c12b5015c3ff508
Author: Father Chrysostomos <[email protected]>
Date: Thu Sep 25 22:08:15 2014 -0700
Add lvrefslice op type
M ext/Opcode/Opcode.pm
M opcode.h
M opnames.h
M pp.c
M pp_proto.h
M regen/opcodes
commit 8af6ccfbe23c86b54f50b3c76eb941eaf8cb74aa
Author: Father Chrysostomos <[email protected]>
Date: Thu Sep 25 20:34:11 2014 -0700
Assignment to array elem refs
M lib/B/Op_private.pm
M mg.c
M op.c
M opcode.h
M pp.c
M regen/op_private
M t/op/lvref.t
commit e66977aee81f760ba4a710b873c7d02b48793f9f
Author: Father Chrysostomos <[email protected]>
Date: Thu Sep 25 16:10:14 2014 -0700
\local $scalar assignment
M op.c
M pp.c
M t/op/lvref.t
commit ca684c6a831dfa5e23fe9bc0837b47e756214228
Author: Father Chrysostomos <[email protected]>
Date: Thu Sep 25 13:10:22 2014 -0700
Make \($x,$y) assignment work
This applies to \ with multiple kids (refgen). Up till now,
op_lvalue_flags only handled srefgen (single refgen).
Before I was converting srefgen to lvref and nulling the kid op:
srefgen
ex-list
rv2sv
gv
became:
lvref
ex-list
ex-rv2sv
gv
Now Iâm converting the kid instead and nulling the srefgen:
ex-srefgen
ex-list
lvref
gv
so that the same code can apply to refgen:
refgen
ex-list
pushmark
rv2sv
gv
rv2sv
gv
becomes
ex-refgen
ex-list
ex-pushmark
lvref
gv
lvref
gv
M op.c
M t/op/lvref.t
M t/op/ref.t
commit e66d61c33fb1c68a415758dffb8f7b636540d94b
Author: Father Chrysostomos <[email protected]>
Date: Thu Sep 25 08:19:13 2014 -0700
List assignment to lexical scalar refs
\($x,$y)=... does not work yet, but \(my $x) and (\$x, \$y) do.
M lib/B/Op_private.pm
M mg.c
M op.c
M opcode.h
M pp.c
M regen/op_private
M t/op/lvref.t
commit bf77ce404326a2182c537d99a55ab5569a8858a7
Author: Father Chrysostomos <[email protected]>
Date: Wed Sep 24 22:13:01 2014 -0700
Fix assertion failure with ... ? \$a : \$b = ...
Because both branches have a srefgen, this was treated as a scalar
reference assignment, which is usually handled by sbind. But sbind
expects the thing on the lhs to be srefgen, not a cond_expr.
The logic for propagating the assignment type must not propagate the
âASSIGN_REFâ type outward. Only list context propagates outward.
Eventually, this will be handled by sassign and the cond_expr will
have lvref kids. (Itâs too complicated for sbind, which is the opti-
mised form that combines \ and = into one op.)
For now, this commit just fixes the assertion failure without making
this type of assignment work yet.
M op.c
M t/op/lvref.t
commit f4d126ff9d9d136d3abf922f54640cb0c796e8e4
Author: Father Chrysostomos <[email protected]>
Date: Wed Sep 24 16:21:03 2014 -0700
op.c: Apply spair optimisation to \% \@ \&
The âspairâ (scalar/single pair) optimisation applies to a few operat-
ors for which there are actually pairs of ops, one for scalars or sin-
gle items, the other for lists. refgen is one of them.
When taking references, hashes, arrays and subroutines are single
items, just like scalars, so they can go through the âsingleâ code and
benefit, too.
sbind will also benefit from this, as \@a = [] (not yet implemented)
should provide scalar context to the right-hand side, and this avoids
the need for special cases (because srefgen with the initial s pro-
vides scalar context).
(This optimisation could have applied to aggregates passed to cho(m)p,
but it results in incorrect messages like âUninitialized value in sca-
lar chompâ for chomp @_, so Iâve left it for now.)
M op.c
M t/lib/warnings/op
commit 6473411c6fe242ad15972e6a488b6c77ddf30bc9
Author: Father Chrysostomos <[email protected]>
Date: Wed Sep 24 16:08:50 2014 -0700
Use âCanât modify reference to...â for sbind, too
M op.c
M t/op/lvref.t
commit e5066bef9fa8f1fe3ea8af459c14188e1b59fd15
Author: Father Chrysostomos <[email protected]>
Date: Wed Sep 24 14:24:06 2014 -0700
op.c: Remove conversion to sbind op type
It is already an sbind by the time we get here. This was a holdover
from an earlier implementation attempt in which the lvref stuff
happened in ck_sassign.
M op.c
commit c5d099088682ddc59a5443e00b9a61663744497c
Author: Father Chrysostomos <[email protected]>
Date: Wed Sep 24 14:22:38 2014 -0700
op.c: diag_listed_as for âCan't modify refâ
M op.c
commit 208bfc629bc297e19d8d47911539874082797441
Author: Father Chrysostomos <[email protected]>
Date: Wed Sep 24 14:20:48 2014 -0700
lvref.t: Test âCan't modify reference to...â
M t/op/lvref.t
commit 946c7da0397ec8cf4fe574a4210c123231acff28
Author: Father Chrysostomos <[email protected]>
Date: Wed Sep 24 13:22:49 2014 -0700
List assignment to package scalar ref
\ on the lhs returns a special magical scalar with set-magic that does
the aliasing.
I considered having a separate abind op that would be like aassign,
but different. However, I realised that for ($x, \$y) = ... to work
it would have to duplicate all of aassign. So I went with the sim-
pler magic implementation.
M mg.c
M op.c
M pp.c
M t/op/lvref.t
commit ed41ae3c512a3431f5e51962b5eb7a88267bbaec
Author: Father Chrysostomos <[email protected]>
Date: Wed Sep 24 01:45:47 2014 -0700
Capitalise magic descriptions consistently
M mg_raw.h
M mg_vtable.h
M pod/perlguts.pod
M regen/mg_vtable.pl
commit 2542a740d0b9196f99117dfd179ccdddbe7ba195
Author: Father Chrysostomos <[email protected]>
Date: Wed Sep 24 01:42:30 2014 -0700
Add lvref magic type
I just couldnât resist using the backslash for the character, even
though I had to tweak mg_vtable.pl to make it work.
M embed.fnc
M embed.h
M mg.c
M mg_names.c
M mg_raw.h
M mg_vtable.h
M pod/perlguts.pod
M proto.h
M regen/mg_vtable.pl
commit 80bd6f0222f744f2545981b2f43d358ef505c983
Author: Father Chrysostomos <[email protected]>
Date: Wed Sep 24 00:58:23 2014 -0700
Add lvref op type
M ext/Opcode/Opcode.pm
M lib/B/Op_private.pm
M opcode.h
M opnames.h
M pp.c
M pp_proto.h
M regen/opcode.pl
M regen/opcodes
commit 0cce2c4f7a9f03ad81602390f6a670bf66961fc9
Author: Father Chrysostomos <[email protected]>
Date: Wed Sep 24 00:19:33 2014 -0700
lvref.t: More parenthesized scalar ref tests
These tests are actually nonsensical with the evals, but they currently
cause syntax errors. Ultimately they are placeholders and reminders,
so it doesnât matter.
M t/op/lvref.t
commit a0769f06366a344fce40e424383065daed160e4d
Author: Father Chrysostomos <[email protected]>
Date: Tue Sep 23 22:33:09 2014 -0700
lvref.t: Some assignments with mixed lhs
M t/op/lvref.t
commit d979b7fad4c7d2d310a24dd230e480403603236c
Author: Father Chrysostomos <[email protected]>
Date: Sun Sep 21 23:11:32 2014 -0700
Implement \my $x = ...
M lib/B/Op_private.pm
M op.c
M opcode.h
M pp.c
M regen/op_private
M t/op/lvref.t
commit 0a6d5b8493823c22d277fd424ecf10f8e2ac9fa2
Author: Father Chrysostomos <[email protected]>
Date: Sun Sep 21 16:04:23 2014 -0700
lvref.t: Test \$foo = \*bar
M t/op/lvref.t
commit 2dd5b93a3723c3b5674d051e214ebef776741166
Author: Father Chrysostomos <[email protected]>
Date: Sun Sep 21 15:04:20 2014 -0700
lvref.t: To-do tests for foreach \
M t/op/lvref.t
commit 6d05d10d1a86ab6d4fc095c3c89452ff631377ea
Author: Father Chrysostomos <[email protected]>
Date: Sun Sep 21 14:58:15 2014 -0700
lvret.t: To-do tests for \local $scalar=
M t/op/lvref.t
commit ff64d87e69aa3cdbfa2be4436c250a4fd7ee3b74
Author: Father Chrysostomos <[email protected]>
Date: Sun Sep 21 14:43:37 2014 -0700
When making lex alias, donât free old var too soon
It could be exactly the same variable, and the reference on the rhs
could be weak:
use feature ":all";
use Scalar::Util 'weaken';
my $a;
weaken($r = \$a);
\$a = $r;
__END__
Lvalue references are experimental at - line 5.
Segmentation fault: 11
M pp.c
M t/op/lvref.t
commit bee54960fec5c0b10d0a1845fd64a18545509b4b
Author: Father Chrysostomos <[email protected]>
Date: Sun Sep 21 14:23:00 2014 -0700
lvref.t: To-do test for PADSTALE handling
M t/op/lvref.t
commit 187dc48752122d4cdf502c6ffe30338156288784
Author: Father Chrysostomos <[email protected]>
Date: Sun Sep 21 13:56:01 2014 -0700
Simple package scalar lvalue refs
\$::x = ... works, but not \local $x yet.
M embed.fnc
M embed.h
M op.c
M pp.c
M proto.h
M sv.c
M t/op/lvref.t
commit cd942df571a7702338a048833d36ff9e92e11e29
Author: Father Chrysostomos <[email protected]>
Date: Sun Sep 21 12:29:30 2014 -0700
lvref.t: Tests for error massages
M t/op/lvref.t
commit 03498f3e94879080b5076fcccb0b4a7696e6de9f
Author: Father Chrysostomos <[email protected]>
Date: Sun Sep 21 11:19:41 2014 -0700
lvref.t: Remove to-do and eval from passing test
This one passing test was failing inside the eval because closures
are not yet supported. (Thatâs why I added explicit closure tests
in the previous commit.)
M t/op/lvref.t
commit 365a43192b0008d1fc3e95ccfb12a5cfebbb3d40
Author: Father Chrysostomos <[email protected]>
Date: Sun Sep 21 11:16:33 2014 -0700
lvref.t: To-do tests for closures
M t/op/lvref.t
commit c78f704dd835310fb3ca5850aa7cb04172cd434f
Author: Father Chrysostomos <[email protected]>
Date: Sun Sep 21 00:22:41 2014 -0700
Document lvalue ref diagnostics
Also, use âa SCALAR referenceâ rather than âa scalar referenceâ, to
match the style used elsewhere.
M pod/perldiag.pod
M pp.c
commit 59f35560c7f6d828c41982c1395b13858dc46dff
Author: Father Chrysostomos <[email protected]>
Date: Sat Sep 20 14:49:04 2014 -0700
First stab at lexical scalar aliases
No \my$x= yet. Only my $x; \$x =....
It does not work properly with variables closed over from outside;
hence, all the to-do tests fail still, since they do the assign-
ment in evals.
But this much works:
$ ./miniperl -Ilib -Mfeature=:all -e 'my $m; \$m = \$n; warn \$m; warn \$n'
Lvalue references are experimental at -e line 1.
SCALAR(0x7fa04b805510) at -e line 1.
SCALAR(0x7fa04b805510) at -e line 1.
M embed.fnc
M embed.h
M op.c
M opcode.h
M pp.c
M proto.h
M regen/opcodes
M scope.c
commit 730427b19560ae0f8bc39d13341a490eadc18639
Author: Father Chrysostomos <[email protected]>
Date: Sat Sep 20 23:33:26 2014 -0700
op.c: In newBINOP, set up op_last before CHECKOP
Set up op_last pointers in newBINOP before calling the op-specific
ck_* routine.
That way, since this op sub-tree is well-formed from the outset, we
donât need as much fix-up code elsewhere to account for the case where
the binop has been embedded inside a larger op tree (state var ini-
tialisation).
The repetition operator is an odd bird. If the lhs is a list of one
item, it is effectively an unop, though still of class binop. Though
op_last would usually point to the last immediate child, it ended
up null instead. B::Deparse was written to expect that, so letâs
keep it that way by setting it to null in ck_repeat, now that the
last = first->sibling assignment in newBINOP (which used to do it)
happens earlier.
M op.c
commit 6e5843cbbb04791748a9200525995ae7946395c8
Author: Father Chrysostomos <[email protected]>
Date: Sat Sep 20 13:48:48 2014 -0700
Increase $Opcode::VERSION to 1.29
M ext/Opcode/Opcode.pm
commit 6413ae73d0355c51d7c52e6f2a73b6d0111f9459
Author: Father Chrysostomos <[email protected]>
Date: Sat Sep 20 13:47:58 2014 -0700
Add sbind op type
M ext/Opcode/Opcode.pm
M lib/B/Op_private.pm
M opcode.h
M opnames.h
M pp.c
M pp_proto.h
M regen/opcodes
commit 81a20d98c1eca679f7a8f5eb614233eb02727ef4
Author: Father Chrysostomos <[email protected]>
Date: Sat Sep 20 13:27:47 2014 -0700
op.c:ck_spair: Remove redundant checks
Neither the av nor the hv ops have the OA_RETSCALAR flag, so these
checks are unreachable.
These checks go all the way back to a0d0e21e (perl 5.000).
M op.c
commit 9ec3dac0da209c505ca0772b47b598cfdc5d6d8f
Author: Father Chrysostomos <[email protected]>
Date: Sat Sep 20 11:46:14 2014 -0700
To-do tests for scalar lvalue refs
M MANIFEST
A t/op/lvref.t
commit da3043222cf49dee529371ea8da618f1bf744511
Author: Father Chrysostomos <[email protected]>
Date: Sat Sep 20 11:16:08 2014 -0700
Increase $warnings::VERSION to 1.27
M lib/warnings.pm
M regen/warnings.pl
commit ea729b1060bba8b424b0c59a31ad63ebff54fa8c
Author: Father Chrysostomos <[email protected]>
Date: Sat Sep 20 11:15:18 2014 -0700
Add experimental::lvalue_refs warnings category
M lib/warnings.pm
M regen/warnings.pl
M warnings.h
commit e3ac08773f6cdf5dfed5057ce960e604ddac0431
Author: Father Chrysostomos <[email protected]>
Date: Sat Sep 20 11:13:58 2014 -0700
Increase $feature::VERSION to 1.38
M lib/feature.pm
M regen/feature.pl
commit f740f1970ca3800dbba07351ccb32c0c024c594a
Author: Father Chrysostomos <[email protected]>
Date: Sat Sep 20 11:12:37 2014 -0700
Add lvalue_refs feature feature
M feature.h
M lib/feature.pm
M regen/feature.pl
-----------------------------------------------------------------------
--
Perl5 Master Repository