Branch: refs/heads/smoke-me/nicholas/pp_iter
  Home:   https://github.com/Perl/perl5
  Commit: b20ce5746c645c7e57e0758edfa6953efa7550f9
      
https://github.com/Perl/perl5/commit/b20ce5746c645c7e57e0758edfa6953efa7550f9
  Author: Nicholas Clark <[email protected]>
  Date:   2021-06-27 (Sun, 27 Jun 2021)

  Changed paths:
    M MANIFEST
    A ext/B/t/optree_for.t

  Log Message:
  -----------
  Tests for existing for loop optrees.


  Commit: eb0ac79ac401d4f8d2de800cce9b2b09fb9e4744
      
https://github.com/Perl/perl5/commit/eb0ac79ac401d4f8d2de800cce9b2b09fb9e4744
  Author: Nicholas Clark <[email protected]>
  Date:   2021-06-27 (Sun, 27 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: ab8b00d93e76a0495fb8acb59b806b00b0b757ca
      
https://github.com/Perl/perl5/commit/ab8b00d93e76a0495fb8acb59b806b00b0b757ca
  Author: Nicholas Clark <[email protected]>
  Date:   2021-06-27 (Sun, 27 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: b243e13909814ad6102e874ac39a84e80b751972
      
https://github.com/Perl/perl5/commit/b243e13909814ad6102e874ac39a84e80b751972
  Author: Nicholas Clark <[email protected]>
  Date:   2021-06-27 (Sun, 27 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: b8537f0377aaad482f67f2b0e4602a62b10739b0
      
https://github.com/Perl/perl5/commit/b8537f0377aaad482f67f2b0e4602a62b10739b0
  Author: Nicholas Clark <[email protected]>
  Date:   2021-06-27 (Sun, 27 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: 5356378bf201e60d9f555a567ed7bcd5094387ad
      
https://github.com/Perl/perl5/commit/5356378bf201e60d9f555a567ed7bcd5094387ad
  Author: Nicholas Clark <[email protected]>
  Date:   2021-06-27 (Sun, 27 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: 772f8a835a22520a09f15650f59ec0281b78c7fd
      
https://github.com/Perl/perl5/commit/772f8a835a22520a09f15650f59ec0281b78c7fd
  Author: Nicholas Clark <[email protected]>
  Date:   2021-06-27 (Sun, 27 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: 307c1e80bb2e3eb42066490d860bcaf466b97cca
      
https://github.com/Perl/perl5/commit/307c1e80bb2e3eb42066490d860bcaf466b97cca
  Author: Nicholas Clark <[email protected]>
  Date:   2021-06-27 (Sun, 27 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: fec6f04a569555461bb432165f507a9ebf602369
      
https://github.com/Perl/perl5/commit/fec6f04a569555461bb432165f507a9ebf602369
  Author: Nicholas Clark <[email protected]>
  Date:   2021-06-27 (Sun, 27 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: 9de606ea1379b27fd37e73dc118e0fd4319fa585
      
https://github.com/Perl/perl5/commit/9de606ea1379b27fd37e73dc118e0fd4319fa585
  Author: Nicholas Clark <[email protected]>
  Date:   2021-06-27 (Sun, 27 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: fa11fbb2919cbac3740e182ca9ff4e66ddd24bcf
      
https://github.com/Perl/perl5/commit/fa11fbb2919cbac3740e182ca9ff4e66ddd24bcf
  Author: Nicholas Clark <[email protected]>
  Date:   2021-06-27 (Sun, 27 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: 5e9f53555ac41e7e07a01b6d638da5a084cf2140
      
https://github.com/Perl/perl5/commit/5e9f53555ac41e7e07a01b6d638da5a084cf2140
  Author: Nicholas Clark <[email protected]>
  Date:   2021-06-27 (Sun, 27 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/5fcc04dd3d00...5e9f53555ac4

Reply via email to