Branch: refs/heads/smoke-me/nicholas/pp_iter Home: https://github.com/Perl/perl5 Commit: 68e3f8f4a90c9a80d8378ea8e6adbd3f555a723a https://github.com/Perl/perl5/commit/68e3f8f4a90c9a80d8378ea8e6adbd3f555a723a Author: Nicholas Clark <n...@ccl4.org> Date: 2021-06-28 (Mon, 28 Jun 2021)
Changed paths: M MANIFEST A ext/B/t/optree_for.t Log Message: ----------- Tests for existing for loop optrees. Commit: 9ceb73f00a6824f7f9ae572962b4d5c6bf5a6c60 https://github.com/Perl/perl5/commit/9ceb73f00a6824f7f9ae572962b4d5c6bf5a6c60 Author: Nicholas Clark <n...@ccl4.org> Date: 2021-06-28 (Mon, 28 Jun 2021) Changed paths: M pp_hot.c Log Message: ----------- Re-indent the case statement in pp_iter, ready for the next commit. This commit is purely a whitespace change. I haven't "tidied" up any of the quirky formatting, just moved it all over by 4 spaces. Commit: 50d9cfcc12ede7bc0f42d215ce777116d0bac21e https://github.com/Perl/perl5/commit/50d9cfcc12ede7bc0f42d215ce777116d0bac21e Author: Nicholas Clark <n...@ccl4.org> Date: 2021-06-28 (Mon, 28 Jun 2021) Changed paths: M pp_hot.c Log Message: ----------- Iterate for loops $n-at-a-time in PP_ITER. This commit provides the runtime changes needed to iterate for loops over two or more variables. Commit: f4f04b7b73577360ac344a79937f1e240e1221aa https://github.com/Perl/perl5/commit/f4f04b7b73577360ac344a79937f1e240e1221aa Author: Nicholas Clark <n...@ccl4.org> Date: 2021-06-28 (Mon, 28 Jun 2021) Changed paths: M op.c Log Message: ----------- Generate the optree for n-at-a-time for loops. Perl_newFOROP can now also take an OP_LIST corresponding to two or more lexicals to iterate over n-at-a-time, where those lexicals are all declared in the for statement, and occupy consecutive pad slots. Commit: ff2aaa4dfbebb07da90981e22e92b60ec811ce5b https://github.com/Perl/perl5/commit/ff2aaa4dfbebb07da90981e22e92b60ec811ce5b Author: Nicholas Clark <n...@ccl4.org> Date: 2021-06-28 (Mon, 28 Jun 2021) Changed paths: M perly.act M perly.h M perly.tab M perly.y M toke.c Log Message: ----------- Implement n-at-a-time for loops. For example, this now works: for my ($key, $value) (%hash) { ... } Only for scalars declared with my as a list in the for loop statement. As many as you want (unless you want more than 4294967296). Commit: 4909d02683925fbabc4811b9773ca0f3c0043997 https://github.com/Perl/perl5/commit/4909d02683925fbabc4811b9773ca0f3c0043997 Author: Nicholas Clark <n...@ccl4.org> Date: 2021-06-28 (Mon, 28 Jun 2021) Changed paths: M MANIFEST M pod/perlsyn.pod A t/op/for-many.t Log Message: ----------- Regression tests and documentation for n-at-a-time for. Commit: 2caf176618da38cc0536cfcf3722e26049b2a3fa https://github.com/Perl/perl5/commit/2caf176618da38cc0536cfcf3722e26049b2a3fa Author: Nicholas Clark <n...@ccl4.org> Date: 2021-06-28 (Mon, 28 Jun 2021) Changed paths: M ext/B/B/Concise.pm M ext/B/t/optree_for.t Log Message: ----------- B::Concise now handles n-at-a-time for. Commit: a5dd876a0d2dfd21ce48fc11c4cb7404cf3ffdcf https://github.com/Perl/perl5/commit/a5dd876a0d2dfd21ce48fc11c4cb7404cf3ffdcf Author: Nicholas Clark <n...@ccl4.org> Date: 2021-06-28 (Mon, 28 Jun 2021) Changed paths: M lib/B/Deparse.pm M lib/B/Deparse.t Log Message: ----------- B::Deparse now handles n-at-a-time for. Commit: dc04eb6f347eaa393df5b6d490fb9169c9f4d9d4 https://github.com/Perl/perl5/commit/dc04eb6f347eaa393df5b6d490fb9169c9f4d9d4 Author: Nicholas Clark <n...@ccl4.org> Date: 2021-06-28 (Mon, 28 Jun 2021) Changed paths: M pp_hot.c Log Message: ----------- Move reading CxTYPE(cx) out of the loop, to be clear that it doesn't change. Move some other variable declarations into a tighter scope, and initialise variables at the point of declaration where possible. With the recent changes, the function consists of a 4-way switch inside a loop, where each iteration of the loop will take the same case in the switch. This implies a branch taken on each iteration of the loop, which is less efficient than the alternative structure of taking the branch once and then looping. However, the way the code is structured (particularly how two of the cases share code, by jumping sideways), means that rewriting it to "switch first" structure would not be clearer (and likely would also be hard to get right). Hence it seems better to let a compiler optimiser choose what is best. However, it might not realise that CxTYPE(cx) won't be changed, even as a side effect of any function called by this code. Hence hoist it into a constant variable to make this unequivocal. Commit: 7df39b3f10dd2706d2776fcb9519d4d6f93b4a2c https://github.com/Perl/perl5/commit/7df39b3f10dd2706d2776fcb9519d4d6f93b4a2c Author: Nicholas Clark <n...@ccl4.org> Date: 2021-06-28 (Mon, 28 Jun 2021) Changed paths: M lib/warnings.pm M regen/warnings.pl M warnings.h Log Message: ----------- Add a new warning experimental::for_list. Commit: 8fbfa368bb53242a338fef11031d1eabab294f57 https://github.com/Perl/perl5/commit/8fbfa368bb53242a338fef11031d1eabab294f57 Author: Nicholas Clark <n...@ccl4.org> Date: 2021-06-28 (Mon, 28 Jun 2021) Changed paths: M pod/perldiag.pod M pod/perlsyn.pod M t/op/for-many.t M toke.c Log Message: ----------- n-at-a-time for loops now warn by default (as 'experimental::for_list'). Commit: 0c36ae8bb7516a41c2fbaf6f8015a303918c0fc3 https://github.com/Perl/perl5/commit/0c36ae8bb7516a41c2fbaf6f8015a303918c0fc3 Author: Nicholas Clark <n...@ccl4.org> Date: 2021-06-28 (Mon, 28 Jun 2021) Changed paths: M pod/perldelta.pod Log Message: ----------- perldelta for n-at-a-time for loops. Compare: https://github.com/Perl/perl5/compare/5e9f53555ac4...0c36ae8bb751