In perl.git, the branch smoke-me/lvref has been created <http://perl5.git.perl.org/perl.git/commitdiff/a90b4f80ac1bef7e336e05eb3167f18803f9b555?hp=0000000000000000000000000000000000000000>
at a90b4f80ac1bef7e336e05eb3167f18803f9b555 (commit) - Log ----------------------------------------------------------------- commit a90b4f80ac1bef7e336e05eb3167f18803f9b555 Author: Father Chrysostomos <spr...@cpan.org> Date: Fri Oct 10 22:16:38 2014 -0700 Make Deparse.t more tolerant of our @F vs our(@F) Currently B::Deparse deparses âour @F;â as âour @F;â, but âour @F =...â as âour(@F) = ...â, adding parentheses. For split-to-array, it just happens to omit the parentheses, because there is no list op for it to process, and it is when processing a list op that it decides to put them there. While it could be changed to omit the parentheses for the list or add them for split-to-array, for now just make the test more tolerant, as this is just a cosmetic difference. M lib/B/Deparse.t commit 670021e145dd10843e1f58923e904dcdbd1a03ef Author: Father Chrysostomos <spr...@cpan.org> Date: Fri Oct 10 21:52:37 2014 -0700 Extend lex alias detection to foreach, too Now that I have added a mechanism for detecting lexical aliases in list assignments, we can extend that to foreach, too, to fix the list- assignment-after-aliasing bug. M op.c M t/op/for.t commit 1da60f326eff41d46f677c39de64d17287d191fa Author: Father Chrysostomos <spr...@cpan.org> Date: Fri Oct 10 21:48:48 2014 -0700 Skip no-common-vars optimisation for lex aliases M op.c M t/op/lvref.t commit eccc1095ad06574c1c3fd70c866b328ecad123e6 Author: Father Chrysostomos <spr...@cpan.org> Date: Fri Oct 10 16:44:58 2014 -0700 op.c: Move common vars check into the peephole optimiser Putting it this late in the compilation phase will facilitate checking for lexical aliases, too. M op.c commit dd4fb7ad4e221e2db40c453bb0027cac50616ccb Author: Father Chrysostomos <spr...@cpan.org> Date: Fri Oct 10 16:37:00 2014 -0700 Update B-Debugâs tests for split optimisation This will have to be submitted upstream after this branch is merged. M cpan/B-Debug/t/debug.t commit 1cef3959062a48aa58b67f953630dcd6a9c2c7c2 Author: Father Chrysostomos <spr...@cpan.org> Date: Fri Oct 10 08:45:29 2014 -0700 op.c: Distangle split and common-vars The split-to-array optimisation was being skipped if the assignment referenced the same variable on both sides, or if it referenced @_ (since @_ aliases other vars). This was to prevent split from freeing its own argument when writing to the array. As the previous commit shows, that didnât actually work properly, and so that commit used a different means to work around that problem. So now there is no reason to skip the optimisation in such cases. @_ = split; @a = split //, $a[0]; now optimise away the assignment. (This also allows me to move the common-vars check into the peep- hole optimiser, where it needs to be to work correctly with lexi- cal aliases.) M op.c commit 002156649b6a438521b650db475c3a8c18d152ed Author: Father Chrysostomos <spr...@cpan.org> Date: Fri Oct 10 08:39:49 2014 -0700 Make split temporarily refcnt its argument In this example, the @a=split... is optimised so that split writes to @a directly: *a = *b; $a[1] = "foobarbaz"; @a = split //, $b[1]; print "@a\n"; But since @a and @b are the same, $b[1] gets freed even before the split occurs. This just happens to work, because copy-on-write saves the day, since the buffer is still valid, the "foobarbaz" constant still holding on to it. This modified example gives me junk: *a = *b; $a[1] = "foobarbaz"; $a[1] .= ""; @a = split //, $b[1]; print "@a\n"; The easiest solution is to make pp_split hold a temporary reference count on the SV. This will also allow the split optimisation to be disentangled from the common-vars pessimisation (which fails here anyway). And *that* will allow the common-vars pessimisation to take lexical aliases into account. M pp.c M t/op/split.t commit bc54be17695112f9e06b1b20604a2d0916306a3c Author: Father Chrysostomos <spr...@cpan.org> Date: Thu Oct 9 22:05:15 2014 -0700 op.c:newASSIGNOP: Rmv LINKLIST call Originally, aassign_common_vars used LINKLIST itself because it was following op_next pointers. That changed in 3023b5f30, so the LINKLIST was moved outside that function. The LINKLIST call could not simply have been deleted, because the split optimisation that follows assumes that it has been called and fixes up an op_next pointer. If we remove the LINKLIST call *and* the op_next fix-up, then every- thing works. The op_next fix-up was only happening to begin with because of LINKLIST. M op.c commit f360cec824e4ad1391c09c69066e715ac9822be7 Author: Father Chrysostomos <spr...@cpan.org> Date: Thu Oct 9 21:54:12 2014 -0700 op.c: Donât keep looping when we see potential common vars When we loop through the list in LIST=..., once we have decided that we need to do the more thorough check for common vars we donât reverse that decision based on subsequent ops, so there is no point in con- tinuing to loop through them. M op.c commit 660ea778780a3b33dbe2d06a6d95a1beb81a5bc2 Author: Father Chrysostomos <spr...@cpan.org> Date: Thu Oct 9 15:53:53 2014 -0700 lvref.t: Remove special TODO code We no longer have a plethora of to-do tests, so this specialised code no longer gains us anything. M t/op/lvref.t commit 674852dfdcf7e771724753fbdc3d8f538ace070f Author: Father Chrysostomos <spr...@cpan.org> Date: Thu Oct 9 15:51:18 2014 -0700 Store internal state of state vars separately Use a separate pad entry to record whether a state variable has been initialised, instead of using a flag on the value. This prevents \$state_var = \$some_other_var from interfering with that internal state. It probably also fixes some cases with foreach as well, but I have not confirmed. M op.c M t/op/lvref.t commit fa967a9e10acb4b6907e0422d4840dcf5e56c510 Author: Father Chrysostomos <spr...@cpan.org> Date: Thu Oct 9 14:07:35 2014 -0700 lvref.t: More list and cond tests M t/op/lvref.t commit 8b065be7e5c84dc59ebf6611682076d735be8407 Author: Father Chrysostomos <spr...@cpan.org> Date: Mon Oct 6 22:12:27 2014 -0700 Deparse lvalue references M ext/B/t/concise-xs.t M lib/B/Deparse.pm M lib/B/Deparse.t commit cdcdcccdffe08a81c641d164aa128aca86ae2867 Author: Father Chrysostomos <spr...@cpan.org> Date: Sat Oct 4 06:35:29 2014 -0700 lvref.t: Remove temporary eval & skip M t/op/lvref.t commit ab8c474b469af6389eefd9c650189cdfc199b2b6 Author: Father Chrysostomos <spr...@cpan.org> Date: Sat Oct 4 06:31:11 2014 -0700 lvref.t: Fix hash elem tests I was testing against a package hash for the âlexicalâ tests. M t/op/lvref.t commit 28a08debb9f5f3fc205b19a5f29ca4b110f31ed0 Author: Father Chrysostomos <spr...@cpan.org> Date: Fri Oct 3 19:50:45 2014 -0700 Handle state vars correctly in ref assignment Only \state(@_) was handling this correctly, as pp_lvavref calls pp_padav. 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 96aa889c593314de0fee98241e4c5b873178b09d Author: Father Chrysostomos <spr...@cpan.org> Date: Fri Oct 3 16:33:55 2014 -0700 lvref.t: Tests for \my assignment and scope exit M t/op/lvref.t commit dbec2d9ac6e5690a4f5889ea744779c1fc230a74 Author: Father Chrysostomos <spr...@cpan.org> Date: Fri Oct 3 12:40:23 2014 -0700 Rework lvref.t foreach tests Remove the to-do marker. Add tests for package vars, too. Redo the \my &a test. Iâve decided not to bother with the âmy &aâ syntax for now (if at all). It is problematic and needs discussion. (If âmy &aâ is allowed in foreach, then it should be allowed else- where, but âmy &a;â would call a stub.) M t/op/lvref.t commit 9d2c61da90d37ba585ab59b6645c10154e4f91e1 Author: Father Chrysostomos <spr...@cpan.org> Date: Fri Oct 3 12:29:35 2014 -0700 Get foreach \&foo working Previously these would crash. Usually, &foo is wrapped in an entersub op which gets converted to rv2cv when refgen applies lvalue context. In foreach \&foo, there is no need for us to go the entersub route; rather we pass the original rv2cv op directly to refgen without the entersub wrapping. So the resulting op tree is different. S_lvref was not expecting this alternate op tree. M op.c commit 38c518ad91422f3a3e6c782a897bc0a25fc679ca Author: Father Chrysostomos <spr...@cpan.org> Date: Thu Oct 2 22:38:27 2014 -0700 foreach \$var Some passing tests are still marked to-do. We need more tests still. M cop.h M mg.c M mg.h M op.c M perly.act M perly.h M perly.tab M perly.y M pp.c M pp_ctl.c M pp_hot.c commit 54d4389b816365e0d3cf143badafe9bf8befae54 Author: Father Chrysostomos <spr...@cpan.org> Date: Thu Oct 2 21:49:28 2014 -0700 Add OPpLVREF_ITER flag An lvalue reference used as an iterator variable will be implemented using an lvref op with this flag set. M lib/B/Op_private.pm M opcode.h M regen/op_private commit fc3404f601fb51797ff73a87f8471555ed77fda5 Author: Father Chrysostomos <spr...@cpan.org> Date: Wed Oct 1 20:18:06 2014 -0700 Fix err message for $cond ? \bad : ... = ... The error message code in S_lvref was assuming that it only handled list assignment (which was originally the case), but $condition ? \pos : whatever = ... goes through that same code path, and that is a scalar assignment. So pass the assignment type through to S_lvref. M op.c M t/op/lvref.t commit c507bfa897648d11a26cdd106bea4ce991f9a5e0 Author: Father Chrysostomos <spr...@cpan.org> Date: Wed Oct 1 20:00:10 2014 -0700 Subroutine reference assignment M op.c M t/op/lvref.t commit 4cc80e2ca01598f358efab764d33092e2e21ccfa Author: Father Chrysostomos <spr...@cpan.org> Date: Wed Oct 1 18:15:16 2014 -0700 lvref.t: Repeat bad ref tests with list assignment List assignment goes through a different code path. The errors come from magic_setlvref in that case, not pp_refassign. M t/op/lvref.t commit b3d56becb7c21b6dadf5eb2e144fd3c6c25d4248 Author: Father Chrysostomos <spr...@cpan.org> Date: Tue Sep 30 22:28:48 2014 -0700 lvref.t: do-block err msg is no longer to-do The previous commitâs rearrangement of things fixed this, too. M t/op/lvref.t commit 3f42aae4c9ec3c7bc115f13a986676d8162ed10f Author: Father Chrysostomos <spr...@cpan.org> Date: Tue Sep 30 22:20:56 2014 -0700 Make \( ?: ) assignment work When I first implemented list assignment to lvalue references, I thought I could simply modify the kids of the refgen op (\) in one spot. But things like ?: make it necessary to do this recursively. So all that code for turning thingies into lvrefs has been moved into a separate function patterned after op_lvalue but handling only the lvref cases. (I thought about combining it with op_lvalueâs switch statement, but that would require âif(type == OP_LVREF) goto nomod;â too many times, which would be harder to maintain.) M op.c M t/op/lvref.t commit 151743e55cc8ba93f5edac32b47a8530bb2a9d64 Author: Father Chrysostomos <spr...@cpan.org> Date: Tue Sep 30 10:28:32 2014 -0700 lvref.t: Remove unnecessary evals M t/op/lvref.t commit 658a351971f92266e994fa25a539b8ebbbac1b85 Author: Father Chrysostomos <spr...@cpan.org> Date: Tue Sep 30 10:27:34 2014 -0700 Get basic $cond ? \$a : \$b = ... working When I started working on lvalue references, I envisioned having all scalar assignments pass through pp_refassign. A refassign op repre- sents the initial backslash on the lhs *and* the equals sign. For cases like this, there is no single refgen on the lhs. It turns out that the approach I am using for list assignments (where the lhs becomes an lvref op that returns a magic scalar that does the aliasing when assigned to) is the easiest way to get this working, too. All this commit has to do is allow âsassignâ lvalue context to apply to srefgen and fix the completely broken to-do tests. (I have a ten- dency to write broken to-do tests, as I have no way of testing them at the time.) M op.c M t/op/lvref.t commit fc4ee875186e94360f038b2b65471d916e90985c Author: Father Chrysostomos <spr...@cpan.org> Date: Mon Sep 29 22:21:21 2014 -0700 Assignment to \(@array) This is a slurpy lvalue that gobbles up all the rhs elements, which are expected to be references. So \(@a)=\(@b) makes @a share the same elements as @b. We implement this by pushing a null on to the stack as a special marker that pp_aassign will recognise. I decided to change the wording for the \local(@a)=... error slightly, from what my to-do tests had. Some of the other to-do tests were badly written and had to be fixed up a bit. M op.c M pp.c M pp_hot.c M t/op/lvref.t commit 206beadef95e769017bf14d0eee1b67718e7d1a6 Author: Father Chrysostomos <spr...@cpan.org> Date: Mon Sep 29 22:23:22 2014 -0700 lvavref needs OPpLVAL_INTRO and OPpPAD_STATE M lib/B/Op_private.pm M opcode.h M regen/op_private commit ab5245386fece93c71bf04e79a6552f35009a330 Author: Father Chrysostomos <spr...@cpan.org> Date: Mon Sep 29 21:43:53 2014 -0700 Add lvavref op type This will be used for slurpy array ref assignments. \(@a) = \(@b) will make @a share the same elements as @b. 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 74c45123de15bac0c6663d1f47f912a8e1f49e90 Author: Father Chrysostomos <spr...@cpan.org> Date: Mon Sep 29 21:40:28 2014 -0700 lvref is actually a baseop/unop When used for pad vars, it is childless. M opcode.h M regen/opcodes commit 8d2bc40839159e46600e193948bd29dec6a10c73 Author: Father Chrysostomos <spr...@cpan.org> Date: Mon Sep 29 18:03:57 2014 -0700 List assignment to array and hash refs (\@a,\%h)=... works, but \(@a) and \(%h) do not. \(%h) correctly croaks. (\local @a, \local %h)=... also works. M mg.c M op.c M pp.c M t/op/lvref.t commit 7aa5b458f464d4e5b63ee063924e92ca9146aefb Author: Father Chrysostomos <spr...@cpan.org> Date: Mon Sep 29 15:48:24 2014 -0700 Renumber OPpLVREF_TYPE to avoid conflicting with OPpPAD_STATE. M lib/B/Op_private.pm M opcode.h M regen/op_private commit ac0da85a81db901d9fb68053bd74f44aac344c80 Author: Father Chrysostomos <spr...@cpan.org> Date: Sun Sep 28 22:17:27 2014 -0700 Assignment to \local @array and \local %hash Doesnât work with lhs parentheses yet. M pp.c M t/op/lvref.t commit 30494daf6820aa3857d002f5d78c5d5a9feb15a5 Author: Father Chrysostomos <spr...@cpan.org> Date: Sun Sep 28 11:45:57 2014 -0700 lvref.t: Tests for localised arrays and hashes M t/op/lvref.t commit 0719038db701ddbd6dd038d7df520bafa71351b9 Author: Father Chrysostomos <spr...@cpan.org> Date: Sun Sep 28 00:53:19 2014 -0700 lvref.t: Test assigning non-array to array Same with hashes. M t/op/lvref.t commit 3f114923fafe08a32936a624ab87ca92d92a109f Author: Father Chrysostomos <spr...@cpan.org> Date: Sun Sep 28 00:52:45 2014 -0700 Simple \@array and \%hash assignment Parentheses do not work yet. Neither does local. M op.c M pp.c M t/op/lvref.t commit 87da42eb7eb28ff70ab5b591192bb7cd5253c0bb Author: Father Chrysostomos <spr...@cpan.org> Date: Sun Sep 28 00:42:09 2014 -0700 lvref.t: To-do tests for hashes Concerning the error message tests, âparenthesized hashâ would be more helpful than âhash dereferenceâ or âprivate hashâ (as would be provided by OP_DESC), as %foo doesnât look like a hash dereference and âprivate hashâ suggests that \%foo= wonât work, whereas it will. M t/op/lvref.t commit c2380ea124638d9a81e736dd179a0113d9cba2aa Author: Father Chrysostomos <spr...@cpan.org> 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 4779e7f945752ceb71b9413e8d75f5754d14940f Author: Father Chrysostomos <spr...@cpan.org> 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 2331e434ee939438b208394da48bb85cf4bc13f7 Author: Father Chrysostomos <spr...@cpan.org> 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 9846cd95ba14e2441e8c1057547316e3a62ca855 Author: Father Chrysostomos <spr...@cpan.org> Date: Sat Sep 27 14:15:50 2014 -0700 pp.c: Some branch prediction hints M pp.c commit 5f94141d59f532c32f6d4fe11724316757ab822e Author: Father Chrysostomos <spr...@cpan.org> 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 05a3480266d84ff8acb7473e8a29dc8383393335 Author: Father Chrysostomos <spr...@cpan.org> 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 a95dad8a993b7576952e2644d1f24c356d163bd1 Author: Father Chrysostomos <spr...@cpan.org> Date: Sat Sep 27 10:49:46 2014 -0700 pp.c:pp_lvrefslice: Unused var M pp.c commit 40d2b8285eb0422bd94b327c5373fc48b2f95a4b Author: Father Chrysostomos <spr...@cpan.org> Date: Sat Sep 27 10:49:24 2014 -0700 \local $a[$ix] assignment M pp.c M t/op/lvref.t commit 0ca7b7f7720bb25ab1fc20faded8002d21b67c88 Author: Father Chrysostomos <spr...@cpan.org> 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 1199b01a19ac3b55dfe962f42e76278451b91b13 Author: Father Chrysostomos <spr...@cpan.org> Date: Thu Sep 25 22:13:33 2014 -0700 pp.c: Dodge compiler warning M pp.c commit 838b9de431ce5a45386778b7c1a764bd71ccd69a Author: Father Chrysostomos <spr...@cpan.org> 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 16b99412618208db59abd8d0e599334702e65a55 Author: Father Chrysostomos <spr...@cpan.org> 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 6102323a2ca31b7c760d9a3b81cb1d3e3d551206 Author: Father Chrysostomos <spr...@cpan.org> 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 2a57afb16e3315d9a0aaa4e79615282cf63c970d Author: Father Chrysostomos <spr...@cpan.org> Date: Thu Sep 25 16:10:14 2014 -0700 \local $scalar assignment M op.c M pp.c M t/op/lvref.t commit 217e35650316a762c07b3b02d10140d30830fb20 Author: Father Chrysostomos <spr...@cpan.org> 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 c146a62a4cab49a74d6cee4acf18e3ec9b40ee60 Author: Father Chrysostomos <spr...@cpan.org> 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 b7ae253e76cba86199de07716b73ab1238d0b134 Author: Father Chrysostomos <spr...@cpan.org> 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 refassign. But refassign 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 refassign, which is the optimised 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 18690b0bb5d5aaa15e5e9637d0a3539e79054b64 Author: Father Chrysostomos <spr...@cpan.org> 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. refassign will also benefit from this, as \@a = [] (not yet imple- mented) should provide scalar context to the right-hand side, and this avoids the need for special cases (because srefgen with the initial s provides 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 d6b7592f28eae79bd117cf78561aca5f0652493a Author: Father Chrysostomos <spr...@cpan.org> Date: Sun Sep 28 22:50:57 2014 -0700 Use âCanât modify reference to...â for refassign, too M op.c M t/op/lvref.t commit 00aced4366ca13d1f6cbc3fdcd7978c665d2986f Author: Father Chrysostomos <spr...@cpan.org> Date: Wed Sep 24 14:22:38 2014 -0700 op.c: diag_listed_as for âCan't modify refâ M op.c commit d637845879a681ae83da2ae1e0be82308365a626 Author: Father Chrysostomos <spr...@cpan.org> Date: Wed Sep 24 14:20:48 2014 -0700 lvref.t: Test âCan't modify reference to...â M t/op/lvref.t commit 26a50d995a0122ec4aec3392722aa70e74fe54f3 Author: Father Chrysostomos <spr...@cpan.org> 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 e5e1ee61c50f938a3a8b7487d29d5128d4f9a909 Author: Father Chrysostomos <spr...@cpan.org> 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 9cce4f9a8471c0b7a6994f36be8819352a4d9483 Author: Father Chrysostomos <spr...@cpan.org> 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 4c5bab508cf172e32fdb9e8567ff635b6d783791 Author: Father Chrysostomos <spr...@cpan.org> 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 238ef7dc59bb442965485ccd157672eaccb98595 Author: Father Chrysostomos <spr...@cpan.org> 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 9fc71ff4f33fb4507ed9a0ffce02bc016d6c9e67 Author: Father Chrysostomos <spr...@cpan.org> Date: Tue Sep 23 22:33:09 2014 -0700 lvref.t: Some assignments with mixed lhs M t/op/lvref.t commit fc048fcf6b2b4fae0ddcafdb47f7bb90c8870494 Author: Father Chrysostomos <spr...@cpan.org> 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 29a3d6280e2f5fe316859471e9be0c27bc46574e Author: Father Chrysostomos <spr...@cpan.org> Date: Sun Sep 21 16:04:23 2014 -0700 lvref.t: Test \$foo = \*bar M t/op/lvref.t commit 096cc2cc8675f82dab8d5d59a5508566d66f286a Author: Father Chrysostomos <spr...@cpan.org> Date: Sun Sep 21 15:04:20 2014 -0700 lvref.t: To-do tests for foreach \ M t/op/lvref.t commit 11ea28eea03107ff32c4edb2bcad68bf6e0a829d Author: Father Chrysostomos <spr...@cpan.org> Date: Sun Sep 21 14:58:15 2014 -0700 lvret.t: To-do tests for \local $scalar= M t/op/lvref.t commit cf5d2d915380445b49999ce7406c0d13237cbe75 Author: Father Chrysostomos <spr...@cpan.org> 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 81cb1af6775a2f7ba663085295061b250c9672a8 Author: Father Chrysostomos <spr...@cpan.org> Date: Sun Sep 21 14:23:00 2014 -0700 lvref.t: To-do test for PADSTALE handling M t/op/lvref.t commit d8a875d93e7c1c1a513ab31bd1684eefe256ca0a Author: Father Chrysostomos <spr...@cpan.org> 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 b3717a0ec6ac22206338b63122a93d6a881fb4ce Author: Father Chrysostomos <spr...@cpan.org> Date: Sun Sep 21 12:29:30 2014 -0700 lvref.t: Tests for error massages M t/op/lvref.t commit 53abf431371b7071bf60734804bbbad21609bd78 Author: Father Chrysostomos <spr...@cpan.org> 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 781ff25d28a50581bf4d85d24e03d232a16c220e Author: Father Chrysostomos <spr...@cpan.org> Date: Sun Sep 21 11:16:33 2014 -0700 lvref.t: To-do tests for closures M t/op/lvref.t commit 1f8155a2946fdd2bc22183ecc33751efdb190512 Author: Father Chrysostomos <spr...@cpan.org> 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 4fec880468dad87517895b935b19a8d51e98b5a6 Author: Father Chrysostomos <spr...@cpan.org> 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 c0d680ed1b5f1cf4e78338bc96d26e636cbc60d6 Author: Father Chrysostomos <spr...@cpan.org> 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 c87926f5ed4dd7c1701a810f4ef8059f19a375c6 Author: Father Chrysostomos <spr...@cpan.org> Date: Sat Sep 20 13:48:48 2014 -0700 Increase $Opcode::VERSION to 1.29 M ext/Opcode/Opcode.pm commit 254da51f7d4c7ed280895a23be679ad865ed467d Author: Father Chrysostomos <spr...@cpan.org> Date: Sat Sep 20 13:47:58 2014 -0700 Add refassign 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 6dbf0444b935d282757d46d944cd2e0eb84e986b Author: Father Chrysostomos <spr...@cpan.org> 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 72ed461802ec8aae014d49fcdef5aba93e93d1eb Author: Father Chrysostomos <spr...@cpan.org> Date: Sat Sep 20 11:46:14 2014 -0700 To-do tests for scalar lvalue refs M MANIFEST A t/op/lvref.t commit be16e595fd8043a26fd91f476ab13f121e70b39c Author: Father Chrysostomos <spr...@cpan.org> Date: Sat Sep 20 11:16:08 2014 -0700 Increase $warnings::VERSION to 1.27 M lib/warnings.pm M regen/warnings.pl commit f438dbf03e8533ecb95016b51e9c54cac5f93251 Author: Father Chrysostomos <spr...@cpan.org> 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 d24d2f9e5e2348d1d9e517cb74b428fb96d1a3ba Author: Father Chrysostomos <spr...@cpan.org> Date: Sat Sep 20 11:13:58 2014 -0700 Increase $feature::VERSION to 1.38 M lib/feature.pm M regen/feature.pl commit 7b1dc818da6dbd8d997858a2acf6a6edf11757e0 Author: Father Chrysostomos <spr...@cpan.org> 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