Branch: refs/heads/blead
  Home:   https://github.com/Perl/perl5
  Commit: 594c45d643751f7afe1092bf6b2bec22a912f135
      
https://github.com/Perl/perl5/commit/594c45d643751f7afe1092bf6b2bec22a912f135
  Author: David Mitchell <da...@iabyn.com>
  Date:   2023-12-06 (Wed, 06 Dec 2023)

  Changed paths:
    M pp.c

  Log Message:
  -----------
  make RC-stack-aware: unwrap pp_index()

Remove the temporary wrapper from pp_index()


  Commit: 591200f6f0f3257838efb8d5103b955e84db6ffd
      
https://github.com/Perl/perl5/commit/591200f6f0f3257838efb8d5103b955e84db6ffd
  Author: David Mitchell <da...@iabyn.com>
  Date:   2023-12-06 (Wed, 06 Dec 2023)

  Changed paths:
    M dist/IO/IO.xs

  Log Message:
  -----------
  IO::getline(): use CALLRUNOPS

This XS function calls Perl_pp_readline() directly. Instead, invoke the
op via CALLRUNOPS(): the run loop (that will just run a single op) can
handle the case of the caller having a non-reference-counted stack,
but when the ops it calls are expecting a reference-counted stack.

Perl_pp_readline() will (in a few commits' time) indeed be expecting a
reference-counted stack.


  Commit: d25231bc219ffc858cb4291da9ca933e958dcf41
      
https://github.com/Perl/perl5/commit/d25231bc219ffc858cb4291da9ca933e958dcf41
  Author: David Mitchell <da...@iabyn.com>
  Date:   2023-12-06 (Wed, 06 Dec 2023)

  Changed paths:
    M dist/IO/IO.xs

  Log Message:
  -----------
  IO::getline() handle OPf_STACKED better

When calling Perl_pp_readline(), only set OPf_STACKED, and only create a
dummy stacked target, when in scalar context. getline() had been sort of
getting away with always setting it, but the next commit but one will
make pp_readline() more strict about its flag handling (basically adding
lots of asserts and only processing the target when OPf_STACKED is set).

This change has been wrapped in a version #ifdef, as on older perls
pp_readline() will unconditionally try to retrieve the targ from the pad
if OPf_STACKED isn't set, and probably crash.

Note that until the next commit but one, this commit will probably fail
t/io_getline.t.


  Commit: 14c47929512aa30191dca1f037cc3584580023c8
      
https://github.com/Perl/perl5/commit/14c47929512aa30191dca1f037cc3584580023c8
  Author: David Mitchell <da...@iabyn.com>
  Date:   2023-12-06 (Wed, 06 Dec 2023)

  Changed paths:
    M pp.h
    M pp_hot.c
    M pp_sys.c

  Log Message:
  -----------
  expand tryAMAGICunTARGETlist() macro

This long macro is only used in two places (pp_readline and pp_glob).
Expand the contents of this macro directly in those two functions.

This will make it easier to individually unwrap (i.e. remove
PP_wrapped()) those two functions.

Shouldn't be any functional change.


  Commit: 651f4b6c76d59d6258fe672000c6ce9a23c993a1
      
https://github.com/Perl/perl5/commit/651f4b6c76d59d6258fe672000c6ce9a23c993a1
  Author: David Mitchell <da...@iabyn.com>
  Date:   2023-12-06 (Wed, 06 Dec 2023)

  Changed paths:
    M gv.c
    M pp.c
    M pp_hot.c
    M pp_sys.c

  Log Message:
  -----------
  make RC-stack-aware: pp_readline(), pp_glob() etc

Remove the temporary wrappers from:

    pp_readline()
    pp_rcatline()
    pp_glob()
    pp_rv2gv()

and dependent functions.

This started out as an attempt to unwrap the simple pp_rv2gv() function.
But pp_readline() calls pp_rv2gv() too, so that had to be unwrapped too.
Then the bulk of pp_readline()'s implementation is done by
do_readline(), so that had to be updated too. But pp_rcatline() and
pp_glob() also call out to do_readline(), so they had to be fixed too.
And pp_glob() outsources most of its work to the XS module File::Glob,
so calling that had to be wrapped to handle a non-refcounted stack in
the XS code. Then it turns out that code in IO.xs calls pp_readline()
directly and needed tweaking.

So now its a large commit that updates nearly everything in one big go.

While fixing up everything, I took the opportunity to add many code
comments and asserts to better document what these various functions do,
and what args they expect on the stack under what flag conditions.

The op_flag processing is now more strict, so potentially other code
which directly fakes up an op with sloppy flag settings and calls one of
these pp functions directly might now trigger an assert failure. (See
the fix-up to IO.xs a couple of commits ago for an example.)


  Commit: 99e4f4b1c4bc11fc21660d3dcd3c6eb584361c54
      
https://github.com/Perl/perl5/commit/99e4f4b1c4bc11fc21660d3dcd3c6eb584361c54
  Author: David Mitchell <da...@iabyn.com>
  Date:   2023-12-06 (Wed, 06 Dec 2023)

  Changed paths:
    M pp.h

  Log Message:
  -----------
  remove unused tryAMAGICunTARGETlist macro

This macro was originally only used in two places in core (pp_readline
and pp_glob), and nowhere on CPAN.

The last few commits inlined those only two usages, then modified the
functions using that code to be PERL_RC_STACK-aware.

Since the macro is now unused, and is the old obsolete non-PERL_RC_STACK
code, this commit just deletes it.


  Commit: 49e6c78e46b366d68f0bef59674dc9dfaed3d131
      
https://github.com/Perl/perl5/commit/49e6c78e46b366d68f0bef59674dc9dfaed3d131
  Author: David Mitchell <da...@iabyn.com>
  Date:   2023-12-06 (Wed, 06 Dec 2023)

  Changed paths:
    M dist/IO/IO.xs
    M gv.c
    M pp.c
    M pp.h
    M pp_hot.c
    M pp_sys.c

  Log Message:
  -----------
  [MERGE] make RC-stack-aware: pp_readline() etc

Remove the temporary wrappers from:

    pp_readline()
    pp_rcatline()
    pp_glob()
    pp_rv2gv()
    pp_index()

and dependent functions.

This branch started out as an attempt to unwrap a few simple functions
like pp_index() and pp_rv2gv(). But pp_readline() calls pp_rv2gv(),
so that had to be unwrapped too. Then the bulk of pp_readline()'s
implementation is done by do_readline(), so that had to be updated too.
But pp_rcatline() and pp_glob() also call out to do_readline(), so they
had to be fixed too. And pp_glob() outsources most of its work to the
XS module File::Glob, so calling that had to be wrapped to handle a
non-refcounted stack in the XS code. Then it turns out that code in
IO.xs calls pp_readline() directly and needed tweaking.

So now its a larger branch that touches a lot of stuff.


Compare: https://github.com/Perl/perl5/compare/450676c25a73...49e6c78e46b3

Reply via email to